<html xmlns:xhtml="http://www.w3.org/1999/xhtml" xmlns:xforms="http://www.w3.org/2002/xforms"
	xmlns:ev="http://www.w3.org/2001/xml-events" xmlns:xs="http://www.w3.org/2001/XMLSchema"
	xmlns="http://www.w3.org/1999/xhtml" xmlns:xxforms="http://orbeon.org/oxf/xml/xforms"
	xmlns:p="http://www.orbeon.com/oxf/pipeline" xmlns:xi="http://www.w3.org/2001/XInclude"
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xmlns:fr="http://orbeon.org/oxf/xml/form-runner">
	<head>
		<title>Numishare: Edit Coin</title>
		<link type="text/css" href="http://localhost:8080/cocoon/numishare/xforms.css"
			rel="stylesheet"/>
		<xforms:model>
			<xs:schema elementFormDefault="qualified" attributeFormDefault="unqualified">
				<xs:simpleType name="iso8601date">
					<xs:restriction base="xs:string">
						<xs:pattern
							value="(\-?(0|1|2)([0-9]{3})(((01|02|03|04|05|06|07|08|09|10|11|12)((0[1-9])|((1|2)[0-9])|(3[0-1])))|\-((01|02|03|04|05|06|07|08|09|10|11|12)(\-((0[1-9])|((1|2)[0-9])|(3[0-1])))?))?)(/\-?(0|1|2)([0-9]{3})(((01|02|03|04|05|06|07|08|09|10|11|12)((0[1-9])|((1|2)[0-9])|(3[0-1])))|\-((01|02|03|04|05|06|07|08|09|10|11|12)(\-((0[1-9])|((1|2)[0-9])|(3[0-1])))?))?)?"
						/>
					</xs:restriction>
				</xs:simpleType>
			</xs:schema>

			<!-- FILE UPLOADS -->
			<xforms:instance id="files-instance">
				<!-- Start with placeholders for three files -->
				<files xmlns="">
					<file xsi:type="xs:anyURI" filename="" mediatype="" size=""/>
				</files>
			</xforms:instance>

			<xforms:instance id="file-template">
				<file xsi:type="xs:anyURI" filename="" mediatype="" size=""/>
			</xforms:instance>

			<xforms:instance id="control-instance">
				<control xmlns="">
					<simple-upload-trigger/>
					<add-upload-trigger/>
					<remove-upload-trigger/>
				</control>
			</xforms:instance>

			<!-- main instance -->
			<xforms:instance id="coin">
				<c level="item" id="" xmlns="">
					<did>
						<unittitle/>
						<physdesc>
							<genreform type="format"/>
						</physdesc>
					</did>
				</c>
			</xforms:instance>

			<xforms:instance id="status">
				<status/>
			</xforms:instance>

			<!-- solr response for id query -->
			<xforms:instance id="is-published">
				<response xmlns=""/>
			</xforms:instance>

			<!-- send to Solr -->
			<xforms:instance id="addIndex">
				<add xmlns=""/>
			</xforms:instance>

			<!-- Instance for Solr commit-->
			<xforms:instance id="sendCommit">
				<commit/>
			</xforms:instance>

			<!-- load URLs from site_info.xml in eXist into form for Solr and CSS file -->
			<xforms:instance id="site-info">
				<site_info xmlns="">
					<url/>
					<solr_url/>
					<images>
						<absolute_path/>
						<thumbnail/>
						<screen/>
					</images>
				</site_info>
			</xforms:instance>



			<!-- templates for allowable elements -->
			<xforms:instance id="abstract-template">
				<abstract xmlns="" label=""/>
			</xforms:instance>
			<xforms:instance id="acqinfo-template">
				<acqinfo xmlns="">
					<p/>
				</acqinfo>
			</xforms:instance>
			<xforms:instance id="appraisal-template">
				<appraisal xmlns="">
					<p/>
				</appraisal>
			</xforms:instance>
			<xforms:instance id="artist-template">
				<persname role="artist" xmlns=""/>
			</xforms:instance>
			<xforms:instance id="axis-template">
				<physfacet xmlns="" type="axis"/>
			</xforms:instance>
			<xforms:instance id="bibliography-template">
				<bibliography xmlns=""/>
			</xforms:instance>
			<xforms:instance id="bibref-template">
				<bibref xmlns="">
					<title render="italic"/>
					<num type="idno"/>
				</bibref>
			</xforms:instance>
			<xforms:instance id="city-template">
				<geogname xmlns="" role="city" normal=""/>
			</xforms:instance>
			<xforms:instance id="color-template">
				<physfacet xmlns="" type="color"/>
			</xforms:instance>
			<xforms:instance id="container-template">
				<container xmlns="" type=""/>
			</xforms:instance>
			<xforms:instance id="controlaccess-template">
				<controlaccess xmlns=""/>
			</xforms:instance>
			<xforms:instance id="corpname-template">
				<corpname xmlns=""/>
			</xforms:instance>
			<xforms:instance id="counterstamp-template">
				<physfacet xmlns="" type="counterstamp"/>
			</xforms:instance>
			<xforms:instance id="custodhist-template">
				<custodhist xmlns="">
					<p/>
				</custodhist>
			</xforms:instance>
			<xforms:instance id="daogrp-template">
				<daogrp xmlns=""/>
			</xforms:instance>
			<xforms:instance id="deity-template">
				<persname xmlns="" role="deity" normal=""/>
			</xforms:instance>
			<xforms:instance id="denomination-template">
				<genreform xmlns="" type="denomination"/>
			</xforms:instance>
			<xforms:instance id="department-template">
				<materialspec xmlns="" type="department"/>
			</xforms:instance>
			<xforms:instance id="dob-template">
				<physfacet xmlns="" type="dob"/>
			</xforms:instance>
			<xforms:instance id="engraver-template">
				<persname role="engraver" xmlns=""/>
			</xforms:instance>
			<xforms:instance id="dimensions-template">
				<dimensions xmlns=""/>
			</xforms:instance>
			<xforms:instance id="edge-template">
				<physfacet xmlns="" type="edge"/>
			</xforms:instance>
			<xforms:instance id="famname-template">
				<famname xmlns="" role=""/>
			</xforms:instance>
			<xforms:instance id="geogname-template">
				<geogname xmlns="" role="" normal=""/>
			</xforms:instance>
			<xforms:instance id="issuer-template">
				<corpname role="issuer" xmlns=""/>
			</xforms:instance>
			<xforms:instance id="maker-template">
				<corpname role="maker" xmlns=""/>
			</xforms:instance>
			<xforms:instance id="manufacture-template">
				<physfacet xmlns="" type="manufacture"/>
			</xforms:instance>
			<xforms:instance id="material-template">
				<physfacet xmlns="" type="material"/>
			</xforms:instance>
			<xforms:instance id="netGrade-template">
				<physfacet xmlns="" type="netGrade"/>
			</xforms:instance>
			<xforms:instance id="obverseType-template">
				<physfacet xmlns="" type="obverseType"/>
			</xforms:instance>
			<xforms:instance id="obverseLegend-template">
				<physfacet xmlns="" type="obverseLegend"/>
			</xforms:instance>
			<xforms:instance id="obverseSymbol-template">
				<physfacet xmlns="" type="obverseSymbol"/>
			</xforms:instance>
			<xforms:instance id="origination-template">
				<origination xmlns=""/>
			</xforms:instance>
			<xforms:instance id="persname-template">
				<persname xmlns="" role="" normal=""/>
			</xforms:instance>
			<xforms:instance id="phystech-template">
				<phystech xmlns="">
					<p/>
				</phystech>
			</xforms:instance>
			<xforms:instance id="ref-template">
				<ref xmlns="" show="new" actuate="onrequest" href=""/>
			</xforms:instance>
			<xforms:instance id="region-template">
				<geogname xmlns="" role="region" normal=""/>
			</xforms:instance>
			<xforms:instance id="reverseGrade-template">
				<physfacet xmlns="" type="reverseGrade"/>
			</xforms:instance>
			<xforms:instance id="reverseType-template">
				<physfacet xmlns="" type="reverseType"/>
			</xforms:instance>
			<xforms:instance id="reverseLegend-template">
				<physfacet xmlns="" type="reverseLegend"/>
			</xforms:instance>
			<xforms:instance id="reverseSymbol-template">
				<physfacet xmlns="" type="reverseSymbol"/>
			</xforms:instance>
			<xforms:instance id="script-template">
				<materialspec xmlns="" type="script"/>
			</xforms:instance>
			<xforms:instance id="sernum-template">
				<physfacet xmlns="" type="sernum"/>
			</xforms:instance>
			<xforms:instance id="signature-template">
				<physfacet xmlns="" type="signature"/>
			</xforms:instance>
			<xforms:instance id="shape-template">
				<physfacet xmlns="" type="shape"/>
			</xforms:instance>
			<xforms:instance id="state-template">
				<geogname xmlns="" role="state" normal=""/>
			</xforms:instance>
			<xforms:instance id="subject-template">
				<subject xmlns=""/>
			</xforms:instance>
			<xforms:instance id="subjectEvent-template">
				<subject type="subjectEvent" xmlns=""/>
			</xforms:instance>
			<xforms:instance id="subjectIssuer-template">
				<subject type="subjectIssuer" xmlns=""/>
			</xforms:instance>
			<xforms:instance id="subjectPerson-template">
				<subject type="subjectPerson" xmlns=""/>
			</xforms:instance>
			<xforms:instance id="subjectPlace-template">
				<subject type="subjectPlace" xmlns=""/>
			</xforms:instance>
			<xforms:instance id="symbol-template">
				<physfacet xmlns="" type="symbol"/>
			</xforms:instance>
			<xforms:instance id="undertype-template">
				<physfacet xmlns="" type="undertype"/>
			</xforms:instance>
			<xforms:instance id="unitid-template">
				<unitid xmlns="" type=""/>
			</xforms:instance>
			<xforms:instance id="unitdate-template">
				<unitdate xmlns="" normal=""/>
			</xforms:instance>
			<xforms:instance id="watermark-template">
				<physfacet xmlns="" type="watermark"/>
			</xforms:instance>
			<xforms:instance id="weight-template">
				<physfacet xmlns="" type="weight"/>
			</xforms:instance>
			<!-- image daoloc templates -->
			<xforms:instance id="thumb_obv-template">
				<daoloc xmlns="" label="thumb_obv" href="" title=""/>
			</xforms:instance>
			<xforms:instance id="screen_obv-template">
				<daoloc xmlns="" label="screen_obv" href="" title=""/>
			</xforms:instance>
			<xforms:instance id="master_obv-template">
				<daoloc xmlns="" label="master_obv" href="" title=""/>
			</xforms:instance>
			<xforms:instance id="thumb_rev-template">
				<daoloc xmlns="" label="thumb_rev" href="" title=""/>
			</xforms:instance>
			<xforms:instance id="screen_rev-template">
				<daoloc xmlns="" label="screen_rev" href="" title=""/>
			</xforms:instance>
			<xforms:instance id="master_rev-template">
				<daoloc xmlns="" label="master_rev" href="" title=""/>
			</xforms:instance>
			<!-- restricted attributes -->
			<xforms:instance id="georole-template">
				<roles xmlns="">
					<role>
						<name>City</name>
						<value>city</value>
					</role>
					<role>
						<name>Region</name>
						<value>region</value>
					</role>
					<role>
						<name>State</name>
						<value>state</value>
					</role>
				</roles>
			</xforms:instance>

			<xforms:instance id="formats">
				<formats xmlns="">
					<format label="Coin" value="coin"/>
					<format label="Medal" value="medal"/>
				</formats>
			</xforms:instance>

			<xforms:instance id="grades">
				<grades xmlns="">
					<grade label="Poor (PO)" value="PO"/>
					<grade label="Fair (Fr)" value="Fr"/>
					<grade label="About Good (AG)" value="AG"/>
					<grade label="Good (G)" value="G"/>
					<grade label="Very Good (VG)" value="VG"/>
					<grade label="Fine (F)" value="F"/>
					<grade label="Very Fine (VF)" value="VF"/>
					<grade label="Extra Fine (EF)" value="EF"/>
					<grade label="About Uncirculated (AU)" value="AU"/>
					<grade label="Uncirculated (Unc)" value="Unc"/>
					<grade label="Brilliant Uncirculated (BU)" value="BU"/>
				</grades>
			</xforms:instance>

			<!-- Controlled Vocabulary Autosuggest  -->
			<!-- Instance containing the query string -->
			<xforms:instance id="suggest-query">
				<query/>
			</xforms:instance>
			<xforms:instance id="suggest-buffer">
				<buffer/>
			</xforms:instance>
			<!-- Instance with the suggestions we get back from Solr -->
			<xforms:instance id="suggestions">
				<suggestions/>
			</xforms:instance>
			<!-- serves to aggregate current itemsets for each autocomplete in repetition -->
			<xforms:instance id="suggestions-aggregate-artist">
				<suggestions xmlns=""/>
			</xforms:instance>
			<xforms:instance id="suggestions-aggregate-color">
				<suggestions xmlns=""/>
			</xforms:instance>
			<xforms:instance id="suggestions-aggregate-city">
				<suggestions xmlns=""/>
			</xforms:instance>
			<xforms:instance id="suggestions-aggregate-origination-city">
				<suggestions xmlns=""/>
			</xforms:instance>
			<xforms:instance id="suggestions-aggregate-corpname">
				<suggestions xmlns=""/>
			</xforms:instance>
			<xforms:instance id="suggestions-aggregate-deity">
				<suggestions xmlns=""/>
			</xforms:instance>
			<xforms:instance id="suggestions-aggregate-denomination">
				<suggestions xmlns=""/>
			</xforms:instance>
			<xforms:instance id="suggestions-aggregate-department">
				<suggestions xmlns=""/>
			</xforms:instance>
			<xforms:instance id="suggestions-aggregate-engraver">
				<suggestions xmlns=""/>
			</xforms:instance>
			<xforms:instance id="suggestions-aggregate-famname">
				<suggestions xmlns=""/>
			</xforms:instance>
			<!--<xforms:instance id="suggestions-aggregate-format">
				<suggestions xmlns=""/>
				</xforms:instance>-->			
			<xforms:instance id="suggestions-aggregate-institution">
				<suggestions xmlns=""/>
			</xforms:instance>
			<xforms:instance id="suggestions-aggregate-issuer">
				<suggestions xmlns=""/>
			</xforms:instance>
			<xforms:instance id="suggestions-aggregate-maker">
				<suggestions xmlns=""/>
			</xforms:instance>
			<xforms:instance id="suggestions-aggregate-material">
				<suggestions xmlns=""/>
			</xforms:instance>
			<xforms:instance id="suggestions-aggregate-persname">
				<suggestions xmlns=""/>
			</xforms:instance>
			<xforms:instance id="suggestions-aggregate-region">
				<suggestions xmlns=""/>
			</xforms:instance>
			<xforms:instance id="suggestions-aggregate-origination-region">
				<suggestions xmlns=""/>
			</xforms:instance>
			<xforms:instance id="suggestions-aggregate-script">
				<suggestions xmlns=""/>
			</xforms:instance>
			<xforms:instance id="suggestions-aggregate-state">
				<suggestions xmlns=""/>
			</xforms:instance>
			<xforms:instance id="suggestions-aggregate-origination-state">
				<suggestions xmlns=""/>
			</xforms:instance>
			<xforms:instance id="suggestions-aggregate-subject">
				<suggestions xmlns=""/>
			</xforms:instance>
			<xforms:instance id="suggestions-aggregate-subjectEvent">
				<suggestions xmlns=""/>
			</xforms:instance>
			<xforms:instance id="suggestions-aggregate-subjectIssuer">
				<suggestions xmlns=""/>
			</xforms:instance>
			<xforms:instance id="suggestions-aggregate-subjectPerson">
				<suggestions xmlns=""/>
			</xforms:instance>
			<xforms:instance id="suggestions-aggregate-subjectPlace">
				<suggestions xmlns=""/>
			</xforms:instance>

			<xforms:instance id="facet-result-template">
				<int name="" xmlns=""/>
			</xforms:instance>

			<xforms:instance id="response-temp">
				<response xmlns="">
					<lst name="responseHeader">
						<int name="status">0</int>
						<int name="QTime">0</int>
					</lst>
					<lst name="terms">
						<lst name="">
							<int name="">1</int>
						</lst>
					</lst>
				</response>
			</xforms:instance>

			<!-- image uploading, base64 encoding and xml-rpc payload -->
			<xforms:instance id="url-generator">
				<config xmlns="">
					<url/>
					<content-type>image/jpeg</content-type>
				</config>
			</xforms:instance>

			<xforms:instance id="base64-doc">
				<file xmlns=""/>
			</xforms:instance>

			<xforms:instance id="new-doc">
				<file xmlns="">
					<document xsi:type="xs:base64Binary" content-type=""/>
				</file>
			</xforms:instance>

			<xforms:instance id="dump">
				<dump xmlns=""/>
			</xforms:instance>

			<xforms:instance id="serialize-config">
				<config xmlns="">
					<directory/>
					<file/>
					<make-directories>false</make-directories>
					<append>false</append>
				</config>
			</xforms:instance>

			<xforms:instance id="delete-config">
				<config xmlns="">
					<delete>
						<file/>
						<directory/>
					</delete>
				</config>
			</xforms:instance>

			<xforms:instance id="image-folder">
				<folder xmlns=""/>
			</xforms:instance>

			<xforms:instance id="call">
				<methodCall xmlns="">
					<methodName>resize</methodName>
					<params>
						<param>
							<value>
								<base64/>
							</value>
						</param>
						<param>
							<value>
								<i4/>
							</value>
						</param>
						<param>
							<value>
								<i4/>
							</value>
						</param>
					</params>

				</methodCall>
			</xforms:instance>

			<xforms:instance id="response">
				<response/>
			</xforms:instance>

			<xforms:instance id="image-side">
				<side xmlns=""/>
			</xforms:instance>

			<!-- set labels for all autocompletes -->
			<xforms:action ev:event="xforms-model-construct-done">
				<xforms:setvalue ref="instance('coin')/@id"
					value="xxforms:get-request-parameter('id')"/>
				<xforms:setvalue ref="instance('coin')/@id"
					value="concat('n_', substring(string(digest( string( random( true ) ), 'MD5', 'hex' )), 1, 8))"
					if="not(string(instance('coin')/@id))"/>
				<xforms:send submission="load-submission"/>
				<xforms:send submission="load-site-info"/>
			</xforms:action>

			<xforms:action ev:event="xforms-ready">
				<!-- political entity -->
				<xforms:action xxforms:iterate="instance('coin')/controlaccess/corpname[not(string(@role))]">
					<xxforms:variable name="name" select="name()"/>
					<xxforms:variable name="facet" select="concat($name, '_facet')"/>
					<xforms:insert context="instance(concat('suggestions-aggregate-', $name))"
						nodeset="response" origin="instance('response-temp')"/>
					<xforms:setvalue
						ref="instance(concat('suggestions-aggregate-', $name))/response[last()]/lst[@name='terms']/lst/@name"
						value="$facet"/>
					<xforms:setvalue
						ref="instance(concat('suggestions-aggregate-', $name))/response[last()]/lst[@name='terms']/lst[@name=$facet]/int/@name"
						value="normalize-space(context())"/>
					<xforms:setindex repeat="{concat($name, '-repeat')}" index="position()"/>
					<xforms:dispatch target="{concat($name, '-autocomplete-control')}"
						name="fr-set-label">
						<xxforms:context name="label"
							select="instance(concat('suggestions-aggregate-', $name))/response[last()]/lst[@name='terms']/lst[@name=$facet]/int/@name"
						/>
					</xforms:dispatch>
				</xforms:action>
				<!-- issuer entity -->
				<xforms:action xxforms:iterate="instance('coin')/controlaccess/corpname[@role='issuer']">
					<xxforms:variable name="name" select="@role"/>
					<xxforms:variable name="facet" select="concat($name, '_facet')"/>
					<xforms:insert context="instance(concat('suggestions-aggregate-', $name))"
						nodeset="response" origin="instance('response-temp')"/>
					<xforms:setvalue
						ref="instance(concat('suggestions-aggregate-', $name))/response[last()]/lst[@name='terms']/lst/@name"
						value="$facet"/>
					<xforms:setvalue
						ref="instance(concat('suggestions-aggregate-', $name))/response[last()]/lst[@name='terms']/lst[@name=$facet]/int/@name"
						value="normalize-space(context())"/>
					<xforms:setindex repeat="{concat($name, '-repeat')}" index="position()"/>
					<xforms:dispatch target="{concat($name, '-autocomplete-control')}"
						name="fr-set-label">
						<xxforms:context name="label"
							select="instance(concat('suggestions-aggregate-', $name))/response[last()]/lst[@name='terms']/lst[@name=$facet]/int/@name"
						/>
					</xforms:dispatch>
				</xforms:action>
				<!-- maker entity -->
				<xforms:action xxforms:iterate="instance('coin')/controlaccess/corpname[@role='maker']">
					<xxforms:variable name="name" select="@role"/>
					<xxforms:variable name="facet" select="concat($name, '_facet')"/>
					<xforms:insert context="instance(concat('suggestions-aggregate-', $name))"
						nodeset="response" origin="instance('response-temp')"/>
					<xforms:setvalue
						ref="instance(concat('suggestions-aggregate-', $name))/response[last()]/lst[@name='terms']/lst/@name"
						value="$facet"/>
					<xforms:setvalue
						ref="instance(concat('suggestions-aggregate-', $name))/response[last()]/lst[@name='terms']/lst[@name=$facet]/int/@name"
						value="normalize-space(context())"/>
					<xforms:setindex repeat="{concat($name, '-repeat')}" index="position()"/>
					<xforms:dispatch target="{concat($name, '-autocomplete-control')}"
						name="fr-set-label">
						<xxforms:context name="label"
							select="instance(concat('suggestions-aggregate-', $name))/response[last()]/lst[@name='terms']/lst[@name=$facet]/int/@name"
						/>
					</xforms:dispatch>
				</xforms:action>
				<!-- famname: dynasty -->
				<xforms:action xxforms:iterate="instance('coin')/controlaccess/famname">
					<xxforms:variable name="name" select="name()"/>
					<xxforms:variable name="facet" select="concat($name, '_facet')"/>
					<xforms:insert context="instance(concat('suggestions-aggregate-', $name))"
						nodeset="response" origin="instance('response-temp')"/>
					<xforms:setvalue
						ref="instance(concat('suggestions-aggregate-', $name))/response[last()]/lst[@name='terms']/lst/@name"
						value="$facet"/>
					<xforms:setvalue
						ref="instance(concat('suggestions-aggregate-', $name))/response[last()]/lst[@name='terms']/lst[@name=$facet]/int/@name"
						value="normalize-space(context())"/>
					<xforms:setindex repeat="{concat($name, '-repeat')}" index="position()"/>
					<xforms:dispatch target="{concat($name, '-autocomplete-control')}"
						name="fr-set-label">
						<xxforms:context name="label"
							select="instance(concat('suggestions-aggregate-', $name))/response[last()]/lst[@name='terms']/lst[@name=$facet]/int/@name"
						/>
					</xforms:dispatch>
				</xforms:action>
				
				<xforms:action
					xxforms:iterate="instance('coin')/did/physdesc/genreform[@type='denomination']">
					<xxforms:variable name="name" select="@type"/>
					<xxforms:variable name="facet" select="concat($name, '_facet')"/>
					<xforms:insert context="instance(concat('suggestions-aggregate-', $name))"
						nodeset="response" origin="instance('response-temp')"/>
					<xforms:setvalue
						ref="instance(concat('suggestions-aggregate-', $name))/response[last()]/lst[@name='terms']/lst/@name"
						value="$facet"/>
					<xforms:setvalue
						ref="instance(concat('suggestions-aggregate-', $name))/response[last()]/lst[@name='terms']/lst[@name=$facet]/int/@name"
						value="normalize-space(context())"/>
					<xforms:setindex repeat="{concat($name, '-repeat')}" index="position()"/>
					<xforms:dispatch target="{concat($name, '-autocomplete-control')}"
						name="fr-set-label">
						<xxforms:context name="label"
							select="instance(concat('suggestions-aggregate-', $name))/response[last()]/lst[@name='terms']/lst[@name=$facet]/int/@name"
						/>
					</xforms:dispatch>
				</xforms:action>

				<!-- city, controlaccess -->
				<xforms:action
					xxforms:iterate="instance('coin')/controlaccess/geogname[@role='city']">
					<xxforms:variable name="name" select="@role"/>
					<xxforms:variable name="facet" select="concat($name, '_facet')"/>
					<xforms:insert context="instance(concat('suggestions-aggregate-', $name))"
						nodeset="response" origin="instance('response-temp')"/>
					<xforms:setvalue
						ref="instance(concat('suggestions-aggregate-', $name))/response[last()]/lst[@name='terms']/lst/@name"
						value="$facet"/>
					<xforms:setvalue
						ref="instance(concat('suggestions-aggregate-', $name))/response[last()]/lst[@name='terms']/lst[@name=$facet]/int/@name"
						value="normalize-space(context())"/>
					<xforms:setindex repeat="{concat($name, '-repeat')}" index="position()"/>
					<xforms:dispatch target="{concat($name, '-autocomplete-control')}"
						name="fr-set-label">
						<xxforms:context name="label"
							select="instance(concat('suggestions-aggregate-', $name))/response[last()]/lst[@name='terms']/lst[@name=$facet]/int/@name"
						/>
					</xforms:dispatch>
				</xforms:action>
				<!-- region, controlaccess -->
				<xforms:action
					xxforms:iterate="instance('coin')/controlaccess/geogname[@role='region']">
					<xxforms:variable name="name" select="@role"/>
					<xxforms:variable name="facet" select="concat($name, '_facet')"/>
					<xforms:insert context="instance(concat('suggestions-aggregate-', $name))"
						nodeset="response" origin="instance('response-temp')"/>
					<xforms:setvalue
						ref="instance(concat('suggestions-aggregate-', $name))/response[last()]/lst[@name='terms']/lst/@name"
						value="$facet"/>
					<xforms:setvalue
						ref="instance(concat('suggestions-aggregate-', $name))/response[last()]/lst[@name='terms']/lst[@name=$facet]/int/@name"
						value="normalize-space(context())"/>
					<xforms:setindex repeat="{concat($name, '-repeat')}" index="position()"/>
					<xforms:dispatch target="{concat($name, '-autocomplete-control')}"
						name="fr-set-label">
						<xxforms:context name="label"
							select="instance(concat('suggestions-aggregate-', $name))/response[last()]/lst[@name='terms']/lst[@name=$facet]/int/@name"
						/>
					</xforms:dispatch>
				</xforms:action>
				<!-- state, controlaccess -->
				<xforms:action
					xxforms:iterate="instance('coin')/controlaccess/geogname[@role='state']">
					<xxforms:variable name="name" select="@role"/>
					<xxforms:variable name="facet" select="concat($name, '_facet')"/>
					<xforms:insert context="instance(concat('suggestions-aggregate-', $name))"
						nodeset="response" origin="instance('response-temp')"/>
					<xforms:setvalue
						ref="instance(concat('suggestions-aggregate-', $name))/response[last()]/lst[@name='terms']/lst/@name"
						value="$facet"/>
					<xforms:setvalue
						ref="instance(concat('suggestions-aggregate-', $name))/response[last()]/lst[@name='terms']/lst[@name=$facet]/int/@name"
						value="normalize-space(context())"/>
					<xforms:setindex repeat="{concat($name, '-repeat')}" index="position()"/>
					<xforms:dispatch target="{concat($name, '-autocomplete-control')}"
						name="fr-set-label">
						<xxforms:context name="label"
							select="instance(concat('suggestions-aggregate-', $name))/response[last()]/lst[@name='terms']/lst[@name=$facet]/int/@name"
						/>
					</xforms:dispatch>
				</xforms:action>
				<!-- city, origination -->
				<xforms:action
					xxforms:iterate="instance('coin')/did/origination/geogname[@role='city']">
					<xxforms:variable name="name" select="@role"/>
					<xxforms:variable name="facet" select="concat($name, '_facet')"/>
					<xforms:insert
						context="instance(concat('suggestions-aggregate-origination-', $name))"
						nodeset="response" origin="instance('response-temp')"/>
					<xforms:setvalue
						ref="instance(concat('suggestions-aggregate-origination-', $name))/response[last()]/lst[@name='terms']/lst/@name"
						value="$facet"/>
					<xforms:setvalue
						ref="instance(concat('suggestions-aggregate-origination-', $name))/response[last()]/lst[@name='terms']/lst[@name=$facet]/int/@name"
						value="normalize-space(context())"/>
					<xforms:setindex repeat="{concat('origination-', $name, '-repeat')}"
						index="position()"/>
					<xforms:dispatch
						target="{concat('origination-', $name, '-autocomplete-control')}"
						name="fr-set-label">
						<xxforms:context name="label"
							select="instance(concat('suggestions-aggregate-origination-', $name))/response[last()]/lst[@name='terms']/lst[@name=$facet]/int/@name"
						/>
					</xforms:dispatch>
				</xforms:action>
				<!-- region, origination -->
				<xforms:action
					xxforms:iterate="instance('coin')/did/origination/geogname[@role='region']">
					<xxforms:variable name="name" select="@role"/>
					<xxforms:variable name="facet" select="concat($name, '_facet')"/>
					<xforms:insert
						context="instance(concat('suggestions-aggregate-origination-', $name))"
						nodeset="response" origin="instance('response-temp')"/>
					<xforms:setvalue
						ref="instance(concat('suggestions-aggregate-origination-', $name))/response[last()]/lst[@name='terms']/lst/@name"
						value="$facet"/>
					<xforms:setvalue
						ref="instance(concat('suggestions-aggregate-origination-', $name))/response[last()]/lst[@name='terms']/lst[@name=$facet]/int/@name"
						value="normalize-space(context())"/>
					<xforms:setindex repeat="{concat('origination-', $name, '-repeat')}"
						index="position()"/>
					<xforms:dispatch
						target="{concat('origination-', $name, '-autocomplete-control')}"
						name="fr-set-label">
						<xxforms:context name="label"
							select="instance(concat('suggestions-aggregate-origination-', $name))/response[last()]/lst[@name='terms']/lst[@name=$facet]/int/@name"
						/>
					</xforms:dispatch>
				</xforms:action>
				<!-- state, origination -->
				<xforms:action
					xxforms:iterate="instance('coin')/did/origination/geogname[@role='state']">
					<xxforms:variable name="name" select="@role"/>
					<xxforms:variable name="facet" select="concat($name, '_facet')"/>
					<xforms:insert
						context="instance(concat('suggestions-aggregate-origination-', $name))"
						nodeset="response" origin="instance('response-temp')"/>
					<xforms:setvalue
						ref="instance(concat('suggestions-aggregate-origination-', $name))/response[last()]/lst[@name='terms']/lst/@name"
						value="$facet"/>
					<xforms:setvalue
						ref="instance(concat('suggestions-aggregate-origination-', $name))/response[last()]/lst[@name='terms']/lst[@name=$facet]/int/@name"
						value="normalize-space(context())"/>
					<xforms:setindex repeat="{concat('origination-', $name, '-repeat')}"
						index="position()"/>
					<xforms:dispatch
						target="{concat('origination-', $name, '-autocomplete-control')}"
						name="fr-set-label">
						<xxforms:context name="label"
							select="instance(concat('suggestions-aggregate-origination-', $name))/response[last()]/lst[@name='terms']/lst[@name=$facet]/int/@name"
						/>
					</xforms:dispatch>
				</xforms:action>
				<!-- material -->
				<xforms:action
					xxforms:iterate="instance('coin')/did/physdesc/physfacet[@type='material']">
					<xxforms:variable name="name" select="@type"/>
					<xxforms:variable name="facet" select="concat($name, '_facet')"/>
					<xforms:insert context="instance(concat('suggestions-aggregate-', $name))"
						nodeset="response" origin="instance('response-temp')"/>
					<xforms:setvalue
						ref="instance(concat('suggestions-aggregate-', $name))/response[last()]/lst[@name='terms']/lst/@name"
						value="$facet"/>
					<xforms:setvalue
						ref="instance(concat('suggestions-aggregate-', $name))/response[last()]/lst[@name='terms']/lst[@name=$facet]/int/@name"
						value="normalize-space(context())"/>
					<xforms:setindex repeat="{concat($name, '-repeat')}" index="position()"/>
					<xforms:dispatch target="{concat($name, '-autocomplete-control')}"
						name="fr-set-label">
						<xxforms:context name="label"
							select="instance(concat('suggestions-aggregate-', $name))/response[last()]/lst[@name='terms']/lst[@name=$facet]/int/@name"
						/>
					</xforms:dispatch>
				</xforms:action>
				<xforms:action
					xxforms:iterate="instance('coin')/did/physdesc/physfacet[@type='color']">
					<xxforms:variable name="name" select="@type"/>
					<xxforms:variable name="facet" select="concat($name, '_facet')"/>
					<xforms:insert context="instance(concat('suggestions-aggregate-', $name))"
						nodeset="response" origin="instance('response-temp')"/>
					<xforms:setvalue
						ref="instance(concat('suggestions-aggregate-', $name))/response[last()]/lst[@name='terms']/lst/@name"
						value="$facet"/>
					<xforms:setvalue
						ref="instance(concat('suggestions-aggregate-', $name))/response[last()]/lst[@name='terms']/lst[@name=$facet]/int/@name"
						value="normalize-space(context())"/>
					<xforms:setindex repeat="{concat($name, '-repeat')}" index="position()"/>
					<xforms:dispatch target="{concat($name, '-autocomplete-control')}"
						name="fr-set-label">
						<xxforms:context name="label"
							select="instance(concat('suggestions-aggregate-', $name))/response[last()]/lst[@name='terms']/lst[@name=$facet]/int/@name"
						/>
					</xforms:dispatch>
				</xforms:action>
				<!-- department -->
				<xforms:action
					xxforms:iterate="instance('coin')/did/materialspec[@type='department']">
					<xxforms:variable name="name" select="@type"/>
					<xxforms:variable name="facet" select="concat($name, '_facet')"/>
					<xforms:insert context="instance(concat('suggestions-aggregate-', $name))"
						nodeset="response" origin="instance('response-temp')"/>
					<xforms:setvalue
						ref="instance(concat('suggestions-aggregate-', $name))/response[last()]/lst[@name='terms']/lst/@name"
						value="$facet"/>
					<xforms:setvalue
						ref="instance(concat('suggestions-aggregate-', $name))/response[last()]/lst[@name='terms']/lst[@name=$facet]/int/@name"
						value="normalize-space(context())"/>
					<xforms:setindex repeat="{concat($name, '-repeat')}" index="position()"/>
					<xforms:dispatch target="{concat($name, '-autocomplete-control')}"
						name="fr-set-label">
						<xxforms:context name="label"
							select="instance(concat('suggestions-aggregate-', $name))/response[last()]/lst[@name='terms']/lst[@name=$facet]/int/@name"
						/>
					</xforms:dispatch>
				</xforms:action>
				<!-- script -->
				<xforms:action xxforms:iterate="instance('coin')/did/materialspec[@type='script']">
					<xxforms:variable name="name" select="@type"/>
					<xxforms:variable name="facet" select="concat($name, '_facet')"/>
					<xforms:insert context="instance(concat('suggestions-aggregate-', $name))"
						nodeset="response" origin="instance('response-temp')"/>
					<xforms:setvalue
						ref="instance(concat('suggestions-aggregate-', $name))/response[last()]/lst[@name='terms']/lst/@name"
						value="$facet"/>
					<xforms:setvalue
						ref="instance(concat('suggestions-aggregate-', $name))/response[last()]/lst[@name='terms']/lst[@name=$facet]/int/@name"
						value="normalize-space(context())"/>
					<xforms:setindex repeat="{concat($name, '-repeat')}" index="position()"/>
					<xforms:dispatch target="{concat($name, '-autocomplete-control')}"
						name="fr-set-label">
						<xxforms:context name="label"
							select="instance(concat('suggestions-aggregate-', $name))/response[last()]/lst[@name='terms']/lst[@name=$facet]/int/@name"
						/>
					</xforms:dispatch>
				</xforms:action>
				<!-- persname: deity -->
				<xforms:action
					xxforms:iterate="instance('coin')/controlaccess/persname[@role='deity']">
					<xxforms:variable name="name" select="@role"/>
					<xxforms:variable name="facet" select="concat($name, '_facet')"/>
					<xforms:insert context="instance(concat('suggestions-aggregate-', $name))"
						nodeset="response" origin="instance('response-temp')"/>
					<xforms:setvalue
						ref="instance(concat('suggestions-aggregate-', $name))/response[last()]/lst[@name='terms']/lst/@name"
						value="$facet"/>
					<xforms:setvalue
						ref="instance(concat('suggestions-aggregate-', $name))/response[last()]/lst[@name='terms']/lst[@name=$facet]/int/@name"
						value="normalize-space(context())"/>
					<xforms:setindex repeat="{concat($name, '-repeat')}" index="position()"/>
					<xforms:dispatch target="{concat($name, '-autocomplete-control')}"
						name="fr-set-label">
						<xxforms:context name="label"
							select="instance(concat('suggestions-aggregate-', $name))/response[last()]/lst[@name='terms']/lst[@name=$facet]/int/@name"
						/>
					</xforms:dispatch>
				</xforms:action>
				<!-- persname: artist -->
				<xforms:action
					xxforms:iterate="instance('coin')/controlaccess/persname[@role='artist']">
					<xxforms:variable name="name" select="@role"/>
					<xxforms:variable name="facet" select="concat($name, '_facet')"/>
					<xforms:insert context="instance(concat('suggestions-aggregate-', $name))"
						nodeset="response" origin="instance('response-temp')"/>
					<xforms:setvalue
						ref="instance(concat('suggestions-aggregate-', $name))/response[last()]/lst[@name='terms']/lst/@name"
						value="$facet"/>
					<xforms:setvalue
						ref="instance(concat('suggestions-aggregate-', $name))/response[last()]/lst[@name='terms']/lst[@name=$facet]/int/@name"
						value="normalize-space(context())"/>
					<xforms:setindex repeat="{concat($name, '-repeat')}" index="position()"/>
					<xforms:dispatch target="{concat($name, '-autocomplete-control')}"
						name="fr-set-label">
						<xxforms:context name="label"
							select="instance(concat('suggestions-aggregate-', $name))/response[last()]/lst[@name='terms']/lst[@name=$facet]/int/@name"
						/>
					</xforms:dispatch>
				</xforms:action>
				<!-- persname: engraver -->
				<xforms:action
					xxforms:iterate="instance('coin')/controlaccess/persname[@role='engraver']">
					<xxforms:variable name="name" select="@role"/>
					<xxforms:variable name="facet" select="concat($name, '_facet')"/>
					<xforms:insert context="instance(concat('suggestions-aggregate-', $name))"
						nodeset="response" origin="instance('response-temp')"/>
					<xforms:setvalue
						ref="instance(concat('suggestions-aggregate-', $name))/response[last()]/lst[@name='terms']/lst/@name"
						value="$facet"/>
					<xforms:setvalue
						ref="instance(concat('suggestions-aggregate-', $name))/response[last()]/lst[@name='terms']/lst[@name=$facet]/int/@name"
						value="normalize-space(context())"/>
					<xforms:setindex repeat="{concat($name, '-repeat')}" index="position()"/>
					<xforms:dispatch target="{concat($name, '-autocomplete-control')}"
						name="fr-set-label">
						<xxforms:context name="label"
							select="instance(concat('suggestions-aggregate-', $name))/response[last()]/lst[@name='terms']/lst[@name=$facet]/int/@name"
						/>
					</xforms:dispatch>
				</xforms:action>
				<!-- persname, none deity -->
				<xforms:action
					xxforms:iterate="instance('coin')/controlaccess/persname[not(@role='deity') and not(@role='artist') and not(@role='engraver')]">
					<xxforms:variable name="name" select="name()"/>
					<xxforms:variable name="facet" select="concat($name, '_facet')"/>
					<xforms:insert context="instance(concat('suggestions-aggregate-', $name))"
						nodeset="response" origin="instance('response-temp')"/>
					<xforms:setvalue
						ref="instance(concat('suggestions-aggregate-', $name))/response[last()]/lst[@name='terms']/lst/@name"
						value="$facet"/>
					<xforms:setvalue
						ref="instance(concat('suggestions-aggregate-', $name))/response[last()]/lst[@name='terms']/lst[@name=$facet]/int/@name"
						value="normalize-space(context())"/>
					<xforms:setindex repeat="{concat($name, '-repeat')}" index="position()"/>
					<xforms:dispatch target="{concat($name, '-autocomplete-control')}"
						name="fr-set-label">
						<xxforms:context name="label"
							select="instance(concat('suggestions-aggregate-', $name))/response[last()]/lst[@name='terms']/lst[@name=$facet]/int/@name"
						/>
					</xforms:dispatch>
				</xforms:action>
				<!-- subject -->
				<xforms:action
					xxforms:iterate="instance('coin')/controlaccess/subject[not(string(@type))]">
					<xxforms:variable name="name" select="name()"/>
					<xxforms:variable name="facet" select="concat($name, '_facet')"/>
					<xforms:insert context="instance(concat('suggestions-aggregate-', $name))"
						nodeset="response" origin="instance('response-temp')"/>
					<xforms:setvalue
						ref="instance(concat('suggestions-aggregate-', $name))/response[last()]/lst[@name='terms']/lst/@name"
						value="$facet"/>
					<xforms:setvalue
						ref="instance(concat('suggestions-aggregate-', $name))/response[last()]/lst[@name='terms']/lst[@name=$facet]/int/@name"
						value="normalize-space(context())"/>
					<xforms:setindex repeat="{concat($name, '-repeat')}" index="position()"/>
					<xforms:dispatch target="{concat($name, '-autocomplete-control')}"
						name="fr-set-label">
						<xxforms:context name="label"
							select="instance(concat('suggestions-aggregate-', $name))/response[last()]/lst[@name='terms']/lst[@name=$facet]/int/@name"
						/>
					</xforms:dispatch>
				</xforms:action>
				<xforms:action
					xxforms:iterate="instance('coin')/controlaccess/subject[@type='subjectEvent']">
					<xxforms:variable name="name" select="@type"/>
					<xxforms:variable name="facet" select="concat($name, '_facet')"/>
					<xforms:insert context="instance(concat('suggestions-aggregate-', $name))"
						nodeset="response" origin="instance('response-temp')"/>
					<xforms:setvalue
						ref="instance(concat('suggestions-aggregate-', $name))/response[last()]/lst[@name='terms']/lst/@name"
						value="$facet"/>
					<xforms:setvalue
						ref="instance(concat('suggestions-aggregate-', $name))/response[last()]/lst[@name='terms']/lst[@name=$facet]/int/@name"
						value="normalize-space(context())"/>
					<xforms:setindex repeat="{concat($name, '-repeat')}" index="position()"/>
					<xforms:dispatch target="{concat($name, '-autocomplete-control')}"
						name="fr-set-label">
						<xxforms:context name="label"
							select="instance(concat('suggestions-aggregate-', $name))/response[last()]/lst[@name='terms']/lst[@name=$facet]/int/@name"
						/>
					</xforms:dispatch>
				</xforms:action>
				<xforms:action
					xxforms:iterate="instance('coin')/controlaccess/subject[@type='subjectIssuer']">
					<xxforms:variable name="name" select="@type"/>
					<xxforms:variable name="facet" select="concat($name, '_facet')"/>
					<xforms:insert context="instance(concat('suggestions-aggregate-', $name))"
						nodeset="response" origin="instance('response-temp')"/>
					<xforms:setvalue
						ref="instance(concat('suggestions-aggregate-', $name))/response[last()]/lst[@name='terms']/lst/@name"
						value="$facet"/>
					<xforms:setvalue
						ref="instance(concat('suggestions-aggregate-', $name))/response[last()]/lst[@name='terms']/lst[@name=$facet]/int/@name"
						value="normalize-space(context())"/>
					<xforms:setindex repeat="{concat($name, '-repeat')}" index="position()"/>
					<xforms:dispatch target="{concat($name, '-autocomplete-control')}"
						name="fr-set-label">
						<xxforms:context name="label"
							select="instance(concat('suggestions-aggregate-', $name))/response[last()]/lst[@name='terms']/lst[@name=$facet]/int/@name"
						/>
					</xforms:dispatch>
				</xforms:action>
				<xforms:action
					xxforms:iterate="instance('coin')/controlaccess/subject[@type='subjectPlace']">
					<xxforms:variable name="name" select="@type"/>
					<xxforms:variable name="facet" select="concat($name, '_facet')"/>
					<xforms:insert context="instance(concat('suggestions-aggregate-', $name))"
						nodeset="response" origin="instance('response-temp')"/>
					<xforms:setvalue
						ref="instance(concat('suggestions-aggregate-', $name))/response[last()]/lst[@name='terms']/lst/@name"
						value="$facet"/>
					<xforms:setvalue
						ref="instance(concat('suggestions-aggregate-', $name))/response[last()]/lst[@name='terms']/lst[@name=$facet]/int/@name"
						value="normalize-space(context())"/>
					<xforms:setindex repeat="{concat($name, '-repeat')}" index="position()"/>
					<xforms:dispatch target="{concat($name, '-autocomplete-control')}"
						name="fr-set-label">
						<xxforms:context name="label"
							select="instance(concat('suggestions-aggregate-', $name))/response[last()]/lst[@name='terms']/lst[@name=$facet]/int/@name"
						/>
					</xforms:dispatch>
				</xforms:action>
				<xforms:action
					xxforms:iterate="instance('coin')/controlaccess/subject[@type='subjectPerson']">
					<xxforms:variable name="name" select="@type"/>
					<xxforms:variable name="facet" select="concat($name, '_facet')"/>
					<xforms:insert context="instance(concat('suggestions-aggregate-', $name))"
						nodeset="response" origin="instance('response-temp')"/>
					<xforms:setvalue
						ref="instance(concat('suggestions-aggregate-', $name))/response[last()]/lst[@name='terms']/lst/@name"
						value="$facet"/>
					<xforms:setvalue
						ref="instance(concat('suggestions-aggregate-', $name))/response[last()]/lst[@name='terms']/lst[@name=$facet]/int/@name"
						value="normalize-space(context())"/>
					<xforms:setindex repeat="{concat($name, '-repeat')}" index="position()"/>
					<xforms:dispatch target="{concat($name, '-autocomplete-control')}"
						name="fr-set-label">
						<xxforms:context name="label"
							select="instance(concat('suggestions-aggregate-', $name))/response[last()]/lst[@name='terms']/lst[@name=$facet]/int/@name"
						/>
					</xforms:dispatch>
				</xforms:action>
			</xforms:action>

			<xforms:submission id="artist-suggest" serialization="none" method="get"
				action="http://localhost:8080/solr/terms?terms.fl=artist_facet&amp;terms.limit=10&amp;terms.sort=index&amp;terms.prefix={instance('suggest-query')}"
				instance="suggestions" replace="instance"/>
			<xforms:submission id="city-suggest" serialization="none" method="get"
				action="http://localhost:8080/solr/terms?terms.fl=city_facet&amp;terms.limit=10&amp;terms.sort=index&amp;terms.prefix={instance('suggest-query')}"
				instance="suggestions" replace="instance"/>
			<xforms:submission id="color-suggest" serialization="none" method="get"
				action="http://localhost:8080/solr/terms?terms.fl=color_facet&amp;terms.limit=10&amp;terms.sort=index&amp;terms.prefix={instance('suggest-query')}"
				instance="suggestions" replace="instance"/>
			<xforms:submission id="corpname-suggest" serialization="none" method="get"
				action="http://localhost:8080/solr/terms?terms.fl=corpname_facet&amp;terms.limit=10&amp;terms.sort=index&amp;terms.prefix={instance('suggest-query')}"
				instance="suggestions" replace="instance"/>
			<xforms:submission id="deity-suggest" serialization="none" method="get"
				action="http://localhost:8080/solr/terms?terms.fl=deity_facet&amp;terms.limit=10&amp;terms.sort=index&amp;terms.prefix={instance('suggest-query')}"
				instance="suggestions" replace="instance"/>			
			<xforms:submission id="denomination-suggest" serialization="none" method="get"
				action="http://localhost:8080/solr/terms?terms.fl=denomination_facet&amp;terms.limit=10&amp;terms.sort=index&amp;terms.prefix={instance('suggest-query')}"
				instance="suggestions" replace="instance"/>
			<xforms:submission id="department-suggest" serialization="none" method="get"
				action="http://localhost:8080/solr/terms?terms.fl=department_facet&amp;terms.limit=10&amp;terms.sort=index&amp;terms.prefix={instance('suggest-query')}"
				instance="suggestions" replace="instance"/>
			<xforms:submission id="engraver-suggest" serialization="none" method="get"
				action="http://localhost:8080/solr/terms?terms.fl=engraver_facet&amp;terms.limit=10&amp;terms.sort=index&amp;terms.prefix={instance('suggest-query')}"
				instance="suggestions" replace="instance"/>
			<xforms:submission id="famname-suggest" serialization="none" method="get"
				action="http://localhost:8080/solr/terms?terms.fl=famname_facet&amp;terms.limit=10&amp;terms.sort=index&amp;terms.prefix={instance('suggest-query')}"
				instance="suggestions" replace="instance"/>
			<xforms:submission id="institution-suggest" serialization="none" method="get"
				action="http://localhost:8080/solr/terms?terms.fl=institution_facet&amp;terms.limit=10&amp;terms.sort=index&amp;terms.prefix={instance('suggest-query')}"
				instance="suggestions" replace="instance"/>
			<xforms:submission id="issuer-suggest" serialization="none" method="get"
				action="http://localhost:8080/solr/terms?terms.fl=issuer_facet&amp;terms.limit=10&amp;terms.sort=index&amp;terms.prefix={instance('suggest-query')}"
				instance="suggestions" replace="instance"/>
			<xforms:submission id="maker-suggest" serialization="none" method="get"
				action="http://localhost:8080/solr/terms?terms.fl=maker_facet&amp;terms.limit=10&amp;terms.sort=index&amp;terms.prefix={instance('suggest-query')}"
				instance="suggestions" replace="instance"/>
			<xforms:submission id="material-suggest" serialization="none" method="get"
				action="http://localhost:8080/solr/terms?terms.fl=material_facet&amp;terms.limit=10&amp;terms.sort=index&amp;terms.prefix={instance('suggest-query')}"
				instance="suggestions" replace="instance"/>
			<xforms:submission id="persname-suggest" serialization="none" method="get"
				action="http://localhost:8080/solr/terms?terms.fl=persname_facet&amp;terms.limit=10&amp;terms.sort=index&amp;terms.prefix={instance('suggest-query')}"
				instance="suggestions" replace="instance"/>
			<xforms:submission id="region-suggest" serialization="none" method="get"
				action="http://localhost:8080/solr/terms?terms.fl=region_facet&amp;terms.limit=10&amp;terms.sort=index&amp;terms.prefix={instance('suggest-query')}"
				instance="suggestions" replace="instance"/>
			<xforms:submission id="script-suggest" serialization="none" method="get"
				action="http://localhost:8080/solr/terms?terms.fl=script_facet&amp;terms.limit=10&amp;terms.sort=index&amp;terms.prefix={instance('suggest-query')}"
				instance="suggestions" replace="instance"/>
			<xforms:submission id="state-suggest" serialization="none" method="get"
				action="http://localhost:8080/solr/terms?terms.fl=state_facet&amp;terms.limit=10&amp;terms.sort=index&amp;terms.prefix={instance('suggest-query')}"
				instance="suggestions" replace="instance"/>
			<xforms:submission id="subject-suggest" serialization="none" method="get"
				action="http://localhost:8080/solr/terms?terms.fl=subject_facet&amp;terms.limit=10&amp;terms.sort=index&amp;terms.prefix={instance('suggest-query')}"
				instance="suggestions" replace="instance"/>
			<xforms:submission id="subjectEvent-suggest" serialization="none" method="get"
				action="http://localhost:8080/solr/terms?terms.fl=subjectEvent_facet&amp;terms.limit=10&amp;terms.sort=index&amp;terms.prefix={instance('suggest-query')}"
				instance="suggestions" replace="instance"/>
			<xforms:submission id="subjectIssuer-suggest" serialization="none" method="get"
				action="http://localhost:8080/solr/terms?terms.fl=subjectIssuer_facet&amp;terms.limit=10&amp;terms.sort=index&amp;terms.prefix={instance('suggest-query')}"
				instance="suggestions" replace="instance"/>
			<xforms:submission id="subjectPerson-suggest" serialization="none" method="get"
				action="http://localhost:8080/solr/terms?terms.fl=subjectPerson_facet&amp;terms.limit=10&amp;terms.sort=index&amp;terms.prefix={instance('suggest-query')}"
				instance="suggestions" replace="instance"/>
			<xforms:submission id="subjectPlace-suggest" serialization="none" method="get"
				action="http://localhost:8080/solr/terms?terms.fl=subjectPlace_facet&amp;terms.limit=10&amp;terms.sort=index&amp;terms.prefix={instance('suggest-query')}"
				instance="suggestions" replace="instance"/>

			<!-- Type for language -->
			<xforms:bind nodeset="instance('coin')">
				<xforms:bind nodeset="@id" required="true()"/>
				<xforms:bind nodeset="did">
					<xforms:bind nodeset="unittitle" required="true()"/>
					<xforms:bind nodeset="unitdate" required="true()">
						<xforms:bind nodeset="@normal" type="iso8601date"/>
					</xforms:bind>
					<xforms:bind nodeset="physdesc">
						<xforms:bind nodeset="genreform[@type='format']" required="true()">
							<xforms:bind constraint="string-length(.) &gt; 0"/>
						</xforms:bind>
						<xforms:bind nodeset="physfacet[@type='netGrade']" required="true()">
							<xforms:bind constraint="string-length(.) &gt; 0"/>
						</xforms:bind>
						<xforms:bind nodeset="physfacet[@type='obverseGrade']" required="true()">
							<xforms:bind constraint="string-length(.) &gt; 0"/>
						</xforms:bind>
						<xforms:bind nodeset="physfacet[@type='reverseGrade']" required="true()">
							<xforms:bind constraint="string-length(.) &gt; 0"/>
						</xforms:bind>
						<xforms:bind nodeset="physfacet[@type='weight']" type="xs:decimal"/>
						<xforms:bind nodeset="dimensions" type="xs:decimal"/>
					</xforms:bind>
				</xforms:bind>
			</xforms:bind>

			<xforms:bind nodeset="instance('control-instance')">
				<xforms:bind nodeset="add-upload-trigger" readonly="false()"/>
				<xforms:bind nodeset="remove-upload-trigger"
					readonly="count(instance('files-instance')/file) le 1"/>
			</xforms:bind>



			<!-- Get obverse file upload, encode it in base64 to include in xml-rpc payload to send to be resized -->
			<xforms:submission id="upload-obverse-resize" method="post" replace="none"
				resource="test:">
				<xforms:action ev:event="xforms-submit-done"
					if="contains(instance('files-instance')/file/@mediatype, 'image/')">
					<xforms:setvalue ref="instance('status')">File uploaded.</xforms:setvalue>
					<xforms:setvalue
						ref="instance('coin')/did/daogrp/daoloc[@label='thumb_obv']/@href"
						value="concat('images/artifacts/thumb/', substring-after(substring-before(instance('files-instance')/file, '.tmp'), 'xforms_upload_'), '.', substring-after(instance('files-instance')/file/@mediatype, 'image/'))"/>
					<xforms:setvalue
						ref="instance('coin')/did/daogrp/daoloc[@label='screen_obv']/@href"
						value="concat('images/artifacts/screen/', substring-after(substring-before(instance('files-instance')/file, '.tmp'), 'xforms_upload_'), '.', substring-after(instance('files-instance')/file/@mediatype, 'image/'))"
						if="contains(instance('files-instance')/file/@mediatype, 'image/')"/>
					<xforms:setvalue
						ref="instance('coin')/did/daogrp/daoloc[@label='master_obv']/@href"
						value="concat('images/artifacts/archive/', substring-after(substring-before(instance('files-instance')/file, '.tmp'), 'xforms_upload_'), '.', substring-after(instance('files-instance')/file/@mediatype, 'image/'))"
						if="contains(instance('files-instance')/file/@mediatype, 'image/')"/>
					<xforms:setvalue
						ref="instance('coin')/did/daogrp/daoloc[@label='thumb_obv']/@title"
						value="instance('files-instance')/file/@filename"
						if="contains(instance('files-instance')/file/@mediatype, 'image/')"/>
					<xforms:setvalue
						ref="instance('coin')/did/daogrp/daoloc[@label='screen_obv']/@title"
						value="instance('files-instance')/file/@filename"
						if="contains(instance('files-instance')/file/@mediatype, 'image/')"/>
					<xforms:setvalue
						ref="instance('coin')/did/daogrp/daoloc[@label='master_obv']/@title"
						value="instance('files-instance')/file/@filename"
						if="contains(instance('files-instance')/file/@mediatype, 'image/')"/>

					<!-- get base64 encoded file and send it to xml-rpc -->
					<xforms:setvalue ref="instance('url-generator')/url"
						value="instance('files-instance')/file"/>
					<xforms:insert context="instance('base64-doc')"
						origin="xxforms:call-xpl('oxf:/apps/numishare/xpl/encode-base64.xpl', 'file', instance('url-generator'), 'data')"/>
					<xforms:setvalue ref="instance('call')/params/param[1]/value/base64"
						value="instance('base64-doc')/document"/>
					<xforms:setvalue ref="instance('new-doc')/document/@content-type"
						value="instance('base64-doc')/document/@content-type"/>

					<!-- THUMBNAIL -->
					<xforms:setvalue ref="instance('call')/params/param[2]/value/i4"
						value="instance('site-info')/images/thumbnail"/>
					<xforms:setvalue ref="instance('call')/params/param[3]/value/i4"
						value="instance('site-info')/images/thumbnail"/>
					<xforms:setvalue ref="instance('image-folder')">thumb</xforms:setvalue>
					<xforms:send submission="post-to-remotemagick"/>

					<!-- SCREEN -->
					<xforms:setvalue ref="instance('call')/params/param[2]/value/i4"
						value="instance('site-info')/images/screen"/>
					<xforms:setvalue ref="instance('call')/params/param[3]/value/i4"
						value="instance('site-info')/images/screen"/>
					<xforms:setvalue ref="instance('image-folder')">screen</xforms:setvalue>
					<xforms:send submission="post-to-remotemagick"/>

					<!-- ARCHIVE -->
					<xforms:setvalue ref="instance('image-folder')">archive</xforms:setvalue>
					<xforms:setvalue ref="instance('serialize-config')/directory"
						value="concat(instance('site-info')/images/absolute_path, instance('image-folder'), '/')"/>
					<xforms:setvalue ref="instance('serialize-config')/file"
						value="concat(substring-after(substring-before(instance('files-instance')/file, '.tmp'), 'xforms_upload_'), '.', substring-after(instance('files-instance')/file/@mediatype, 'image/'))"/>
					<!-- copy file from temp to archive folder -->
					<xforms:insert context="instance('dump')"
						origin="xxforms:call-xpl('oxf:/apps/numishare/xpl/archive-file.xpl', ('file', 'serialize-config', 'dump'), (instance('url-generator'), instance('serialize-config'), instance('dump')), 'data')"/>

					<!-- clean up -->
					<xforms:delete context="instance('base64-doc')/document"/>
					<xforms:delete context="instance('dump')/document"/>
					<xforms:setvalue ref="instance('image-side')" value="''"/>
				</xforms:action>
			</xforms:submission>

			<!-- Get reverse file upload, encode it in base64 to include in xml-rpc payload to send to be resized -->
			<xforms:submission id="upload-reverse-resize" method="post" replace="none"
				resource="test:">
				<xforms:action ev:event="xforms-submit-done"
					if="contains(instance('files-instance')/file/@mediatype, 'image/')">
					<xforms:setvalue ref="instance('status')">File uploaded.</xforms:setvalue>
					<xforms:setvalue
						ref="instance('coin')/did/daogrp/daoloc[@label='thumb_rev']/@href"
						value="concat('images/artifacts/thumb/', substring-after(substring-before(instance('files-instance')/file, '.tmp'), 'xforms_upload_'), '.', substring-after(instance('files-instance')/file/@mediatype, 'image/'))"/>
					<xforms:setvalue
						ref="instance('coin')/did/daogrp/daoloc[@label='screen_rev']/@href"
						value="concat('images/artifacts/screen/', substring-after(substring-before(instance('files-instance')/file, '.tmp'), 'xforms_upload_'), '.', substring-after(instance('files-instance')/file/@mediatype, 'image/'))"
						if="contains(instance('files-instance')/file/@mediatype, 'image/')"/>
					<xforms:setvalue
						ref="instance('coin')/did/daogrp/daoloc[@label='master_rev']/@href"
						value="concat('images/artifacts/archive/', substring-after(substring-before(instance('files-instance')/file, '.tmp'), 'xforms_upload_'), '.', substring-after(instance('files-instance')/file/@mediatype, 'image/'))"
						if="contains(instance('files-instance')/file/@mediatype, 'image/')"/>
					<xforms:setvalue
						ref="instance('coin')/did/daogrp/daoloc[@label='thumb_rev']/@title"
						value="instance('files-instance')/file/@filename"
						if="contains(instance('files-instance')/file/@mediatype, 'image/')"/>
					<xforms:setvalue
						ref="instance('coin')/did/daogrp/daoloc[@label='screen_rev']/@title"
						value="instance('files-instance')/file/@filename"
						if="contains(instance('files-instance')/file/@mediatype, 'image/')"/>
					<xforms:setvalue
						ref="instance('coin')/did/daogrp/daoloc[@label='master_rev']/@title"
						value="instance('files-instance')/file/@filename"
						if="contains(instance('files-instance')/file/@mediatype, 'image/')"/>

					<!-- get base64 encoded file and send it to xml-rpc -->
					<xforms:setvalue ref="instance('url-generator')/url"
						value="instance('files-instance')/file"/>
					<xforms:insert context="instance('base64-doc')"
						origin="xxforms:call-xpl('oxf:/apps/numishare/xpl/encode-base64.xpl', 'file', instance('url-generator'), 'data')"/>
					<xforms:setvalue ref="instance('call')/params/param[1]/value/base64"
						value="instance('base64-doc')/document"/>
					<xforms:setvalue ref="instance('new-doc')/document/@content-type"
						value="instance('base64-doc')/document/@content-type"/>

					<!-- THUMBNAIL -->
					<xforms:setvalue ref="instance('call')/params/param[2]/value/i4"
						value="instance('site-info')/images/thumbnail"/>
					<xforms:setvalue ref="instance('call')/params/param[3]/value/i4"
						value="instance('site-info')/images/thumbnail"/>
					<xforms:setvalue ref="instance('image-folder')">thumb</xforms:setvalue>
					<xforms:send submission="post-to-remotemagick"/>

					<!-- SCREEN -->
					<xforms:setvalue ref="instance('call')/params/param[2]/value/i4"
						value="instance('site-info')/images/screen"/>
					<xforms:setvalue ref="instance('call')/params/param[3]/value/i4"
						value="instance('site-info')/images/screen"/>
					<xforms:setvalue ref="instance('image-folder')">screen</xforms:setvalue>
					<xforms:send submission="post-to-remotemagick"/>

					<!-- ARCHIVE -->
					<xforms:setvalue ref="instance('image-folder')">archive</xforms:setvalue>
					<xforms:setvalue ref="instance('serialize-config')/directory"
						value="concat(instance('site-info')/images/absolute_path, instance('image-folder'), '/')"/>
					<xforms:setvalue ref="instance('serialize-config')/file"
						value="concat(substring-after(substring-before(instance('files-instance')/file, '.tmp'), 'xforms_upload_'), '.', substring-after(instance('files-instance')/file/@mediatype, 'image/'))"/>
					<!-- copy file from temp to archive folder -->
					<xforms:insert context="instance('dump')"
						origin="xxforms:call-xpl('oxf:/apps/numishare/xpl/archive-file.xpl', ('file', 'serialize-config', 'dump'), (instance('url-generator'), instance('serialize-config'), instance('dump')), 'data')"/>

					<!-- delete upload action -->
					<xforms:delete context="instance('upload-action')/action[1]"/>

					<!-- clean up -->
					<xforms:delete context="instance('base64-doc')/document"/>
					<xforms:delete context="instance('dump')/document"/>
					<xforms:setvalue ref="instance('image-side')" value="''"/>
				</xforms:action>
			</xforms:submission>

			<xforms:submission id="post-to-remotemagick" method="post" replace="instance"
				instance="response" action="http://localhost:8042/RPC2" ref="instance('call')">
				<xforms:action ev:event="xforms-submit-done">
					<xforms:setvalue ref="instance('new-doc')/document"
						value="instance('response')/params/param/value/string"/>

					<!-- set serialize config values-->
					<xforms:setvalue ref="instance('serialize-config')/directory"
						value="concat(instance('site-info')/images/absolute_path, instance('image-folder'), '/')"/>
					<xforms:setvalue ref="instance('serialize-config')/file"
						value="concat(substring-after(substring-before(instance('files-instance')/file, '.tmp'), 'xforms_upload_'), '.', substring-after(instance('files-instance')/file/@mediatype, 'image/'))"/>

					<!-- serialize new base64 encoded thumbnail into a file -->
					<xforms:insert context="instance('dump')"
						origin="xxforms:call-xpl('oxf:/apps/numishare/xpl/serialize-base64.xpl', ('document', 'dump', 'serialize-config'), (instance('new-doc')/document, instance('dump'), instance('serialize-config')), 'data')"/>

					<!-- clean up -->
					<xforms:delete context="instance('dump')/document"/>
				</xforms:action>
			</xforms:submission>

			<!-- Load File -->
			<xforms:submission id="load-submission" serialization="none" method="get"
				action="/exist/rest/db/numishare/ead/{instance('coin')/@id}.xml"
				xxforms:username="admin" xxforms:password="admin" replace="instance" instance="coin"/>
			<!-- Save File -->
			<xforms:submission id="save-submission" ref="instance('coin')" xxforms:username="admin"
				xxforms:password="admin"
				action="/exist/rest/db/numishare/ead/{instance('coin')/@id}.xml" method="put"
				replace="none">
				<xforms:setvalue ev:event="xforms-submit-done" ref="instance('status')">Coin
					saved.</xforms:setvalue>
				<xforms:message ev:event="xforms-submit-error" level="modal">Save
					Error. Are all required inputs filled?</xforms:message>
				<!-- check to see if the document is already published to Solr -->
				<xforms:send ev:event="xforms-submit-done" submission="query-solr-for-publication"/>
			</xforms:submission>
			<!-- submission to query solr to see if the document is published -->
			<xforms:submission id="query-solr-for-publication" serialization="none" method="get"
				action="{instance('site-info')/solr_url}select/?q=id:{instance('coin')/@id}"
				replace="instance" instance="is-published">
				<!-- if the document is found in solr, get the updated solr doc -->
				<xforms:send ev:event="xforms-submit-done"
					if="instance('is-published')/result[@name='response']/@numFound = '1'"
					submission="to-solr"/>
			</xforms:submission>
			<!-- access service to read in pre-transformed solr doc -->
			<xforms:submission id="to-solr" method="get" replace="instance" instance="addIndex"
				serialization="none"
				resource="{instance('site-info')/url}display/ead/{instance('coin')/@id}.solr">
				<xforms:message ev:event="xforms-submit-error" level="modal">Error transforming EAD
					guide to Solr document.</xforms:message>
				<xforms:send ev:event="xforms-submit-done" submission="publish-submission"/>
			</xforms:submission>
			<!-- post instance to Solr -->
			<xforms:submission id="publish-submission"
				action="{instance('site-info')/solr_url}update" ref="instance('addIndex')"
				instance="addIndex" replace="instance" method="post">
				<xforms:send ev:event="xforms-submit-done" submission="submit-commit"/>
				<xforms:setvalue ev:event="xforms-submit-done" ref="instance('status')">Artifact
					saved and updated to search index.</xforms:setvalue>
				<xforms:message ev:event="xforms-submit-error" level="modal">Data Failed to POST to
					Solr. Index may be offline or URL is incorrect.</xforms:message>
			</xforms:submission>
			<!-- send commit -->
			<xforms:submission id="submit-commit" action="{instance('site-info')/solr_url}update"
				ref="instance('sendCommit')" instance="sendCommit" replace="none" method="post"/>

			<!-- delete upload action -->
			<xforms:delete context="instance('upload-action')/action[last()]"/>

			<!-- load site info -->
			<xforms:submission id="load-site-info" serialization="none" method="get"
				action="/exist/rest/db/numishare/site_info.xml" xxforms:username="admin"
				xxforms:password="admin" replace="instance" instance="site-info"/>
		</xforms:model>
	</head>
	<body>

		<div class="form">
			<!--<span style="float:right;">
			<a href="logout">Logout</a>
			</span>-->
			<xforms:group ref="instance('status')/text()">
				<div class="success">
					<xforms:output ref="instance('status')"/>
				</div>
			</xforms:group>
			<div class="submission">
				<xforms:submit submission="save-submission" appearance="minimal">
					<xforms:label class="file_control"><img src="/apps/numishare/images/save.gif"
							alt="Save"/> Save</xforms:label>
				</xforms:submit>
				<xforms:submit submission="load-submission" appearance="minimal">
					<xforms:label class="file_control"><img
							src="/apps/numishare/images/recycle-green.png" alt="Load"/>
						Load</xforms:label>
				</xforms:submit>
			</div>
			<h1>Create/Edit Coin</h1>
			<xforms:group ref="instance('coin')">
				<span class="add">
					<xforms:trigger appearance="minimal">
						<xforms:label>
							<xhtml:img src="/apps/numishare/images/add.gif"/>
						</xforms:label>
						<xxforms:show ev:event="DOMActivate" dialog="main-objects"/>
					</xforms:trigger>
				</span>
				<xxforms:dialog id="main-objects" appearance="full" level="modal" close="true"
					draggable="true" visible="false">
					<xforms:label>Descriptors</xforms:label>
					<xforms:group ref=".[count(//bibliography) &lt; 1]">
						<xforms:trigger appearance="minimal">
							<xforms:label>
								<img src="/apps/numishare/images/add.gif"/>References</xforms:label>
							<xforms:insert ev:event="DOMActivate" context="."
								origin="instance('bibliography-template')"
								nodeset="./child::node()[last()]"/>
						</xforms:trigger>
					</xforms:group>
					<xforms:group ref=".[count(//daogrp) &lt; 1]">
						<xforms:trigger appearance="minimal">
							<xforms:label>
								<img src="/apps/numishare/images/add.gif"/>Images</xforms:label>
							<xforms:insert ev:event="DOMActivate" context="."
								origin="instance('daogrp-template')"
								nodeset="did/child::node()[last()]"/>
						</xforms:trigger>
					</xforms:group>
					<xforms:group ref=".[count(//controlaccess) &lt; 1]">
						<xforms:trigger appearance="minimal">
							<xforms:label>
								<img src="/apps/numishare/images/add.gif"/>Index
								Terms</xforms:label>
							<xforms:insert ev:event="DOMActivate" context="."
								origin="instance('controlaccess-template')"
								nodeset="./child::node()[last()]"/>
						</xforms:trigger>
					</xforms:group>
					<xforms:group ref=".[count(//origination) &lt; 1]">
						<xforms:trigger appearance="minimal">
							<xforms:label>
								<img src="/apps/numishare/images/add.gif"
								/>Mint/Origination</xforms:label>
							<xforms:insert ev:event="DOMActivate" context="."
								origin="instance('origination-template')"
								nodeset="did/child::node()[last()]"/>
						</xforms:trigger>
					</xforms:group>
				</xxforms:dialog>
				<!--<td/>-->
				<div class="section">
					<h2>Identifying Information</h2>
					<span class="add">
						<xforms:trigger appearance="minimal">
							<xforms:label>
								<xhtml:img src="/apps/numishare/images/add.gif"/>
							</xforms:label>
							<xxforms:show ev:event="DOMActivate" dialog="did-objects"/>
						</xforms:trigger>
					</span>
					<xxforms:dialog id="did-objects" appearance="full" level="modal" close="true"
						draggable="true" visible="false">
						<xforms:label>Identifying Descriptors</xforms:label>
						<xforms:trigger appearance="minimal">
							<xforms:label>
								<img src="/apps/numishare/images/add.gif"/>Container</xforms:label>
							<xforms:insert ev:event="DOMActivate" context="."
								origin="instance('container-template')"
								nodeset="did/child::node()[last()]"/>
						</xforms:trigger>
						<xforms:group ref=".[count(//unitdate) &lt; 1]">
							<xforms:trigger appearance="minimal">
								<xforms:label>
									<img src="/apps/numishare/images/add.gif"/>Date</xforms:label>
								<xforms:insert ev:event="DOMActivate" context="."
									origin="instance('unitdate-template')"
									nodeset="did/child::node()[last()]"/>
							</xforms:trigger>
						</xforms:group>
						<xforms:group ref=".[count(//unitid) &lt; 1]">
							<xforms:trigger appearance="minimal">
								<xforms:label>
									<img src="/apps/numishare/images/add.gif"
									/>Identifier</xforms:label>
								<xforms:insert ev:event="DOMActivate" context="."
									origin="instance('unitid-template')"
									nodeset="did/child::node()[last()]"/>
							</xforms:trigger>
						</xforms:group>
						<xforms:trigger appearance="minimal">
							<xforms:label>
								<img src="/apps/numishare/images/add.gif"/>Department</xforms:label>
							<xforms:insert ev:event="DOMActivate" context="."
								origin="instance('department-template')"
								nodeset="did/child::node()[last()]"/>
						</xforms:trigger>
						<xforms:trigger appearance="minimal">
							<xforms:label>
								<img src="/apps/numishare/images/add.gif"/>Script</xforms:label>
							<xforms:insert ev:event="DOMActivate" context="."
								origin="instance('script-template')"
								nodeset="did/child::node()[last()]"/>
						</xforms:trigger>
					</xxforms:dialog>
					<div>
						<xforms:input ref="@id" class="doc_id">
							<xforms:label>Document ID</xforms:label>
							<xforms:alert>The doc id is required</xforms:alert>
						</xforms:input>
					</div>
					<div>
						<xforms:input ref="did/unittitle">
							<xforms:label>Title</xforms:label>
							<xforms:alert>The title is required</xforms:alert>
						</xforms:input>
					</div>
					<xforms:group ref="did">
						<!-- container -->
						<xforms:repeat id="container" nodeset="container">
							<div>
								<xforms:input ref=".">
									<xforms:label>Container</xforms:label>
								</xforms:input>
								<xforms:trigger appearance="minimal">
									<xforms:delete ev:event="DOMActivate" nodeset="."
										at="index('container')"/>
									<xforms:label>
										<img src="/apps/numishare/images/remove.gif"/>
									</xforms:label>
								</xforms:trigger>
							</div>
						</xforms:repeat>
						<!-- insert date -->
						<xforms:repeat id="unitdate" nodeset="unitdate">
							<div class="pair_div">
								<div>
									<xforms:input ref=".">
										<xforms:label>Text Date</xforms:label>
									</xforms:input>
								</div>
								<div>
									<xforms:input ref="@normal">
										<xforms:label>Machine-readable Date</xforms:label>
										<xforms:alert>Must conform to IS0 8601 date
											specification.</xforms:alert>
									</xforms:input>
								</div>
								<div style="float:right;">
									<xforms:trigger appearance="minimal">
										<xforms:delete ev:event="DOMActivate" nodeset="."
											at="index('unitdate')"/>
										<xforms:label>
											<img src="/apps/numishare/images/remove.gif"/>
										</xforms:label>
									</xforms:trigger>
								</div>
							</div>
						</xforms:repeat>
						<!-- insert unit id -->
						<xforms:repeat id="unitid" nodeset="unitid">
							<div class="pair_div">
								<div>
									<xforms:input ref=".">
										<xforms:label>Unit Identifier</xforms:label>
									</xforms:input>
								</div>
								<div>
									<xforms:input ref="@type">
										<xforms:label>Identifier Type</xforms:label>
										<xforms:hint>e.g. 'accession'</xforms:hint>
									</xforms:input>
								</div>
								<div style="float:right;">
									<xforms:trigger appearance="minimal">
										<xforms:delete ev:event="DOMActivate" nodeset="."
											at="index('unitid')"/>
										<xforms:label>
											<img src="/apps/numishare/images/remove.gif"/>
										</xforms:label>
									</xforms:trigger>
								</div>
							</div>
						</xforms:repeat>
						<!-- insert department -->
						<xi:include href="inputs/department.xml"/>
						<!-- insert script -->
						<xi:include href="inputs/script.xml"/>
					</xforms:group>
				</div>
				<div class="section">
					<!-- physical attributes -->
					<h2>Physical Attributes</h2>
					<span class="add">
						<xforms:trigger appearance="minimal">
							<xforms:label>
								<xhtml:img src="/apps/numishare/images/add.gif"/>
							</xforms:label>
							<xxforms:show ev:event="DOMActivate" dialog="physdesc-objects"/>
						</xforms:trigger>
					</span>
					<xxforms:dialog id="physdesc-objects" appearance="full" level="modal"
						close="true" draggable="true" visible="false">
						<xforms:label>Physical Descriptors</xforms:label>
						<xforms:trigger appearance="minimal">
							<xforms:label>
								<img src="/apps/numishare/images/add.gif"
								/>Denomination</xforms:label>
							<xforms:insert ev:event="DOMActivate" context="."
								origin="instance('denomination-template')"
								nodeset="did/physdesc/child::node()[last()]"/>
						</xforms:trigger>
						<xforms:group ref=".[count(//physfacet[@type='axis']) &lt; 1]">
							<xforms:trigger appearance="minimal">
								<xforms:label>
									<img src="/apps/numishare/images/add.gif"/>Axis</xforms:label>
								<xforms:insert ev:event="DOMActivate" context="."
									origin="instance('axis-template')"
									nodeset="did/physdesc/child::node()[last()]"/>
							</xforms:trigger>
						</xforms:group>
						<xforms:trigger appearance="minimal">
							<xforms:label>
								<img src="/apps/numishare/images/add.gif"/>Color</xforms:label>
							<xforms:insert ev:event="DOMActivate" context="."
								origin="instance('color-template')"
								nodeset="did/physdesc/child::node()[last()]"/>
						</xforms:trigger>
						<xforms:group ref=".[count(//physfacet[@type='counterstamp']) &lt; 1]">
							<xforms:trigger appearance="minimal">
								<xforms:label>
									<img src="/apps/numishare/images/add.gif"
									/>Counterstamp</xforms:label>
								<xforms:insert ev:event="DOMActivate" context="."
									origin="instance('counterstamp-template')"
									nodeset="did/physdesc/child::node()[last()]"/>
							</xforms:trigger>
						</xforms:group>
						<xforms:group ref=".[count(//physfacet[@type='dob']) &lt; 1]">
							<xforms:trigger appearance="minimal">
								<xforms:label>
									<img src="/apps/numishare/images/add.gif"/>Date on
									Object</xforms:label>
								<xforms:insert ev:event="DOMActivate" context="."
									origin="instance('dob-template')"
									nodeset="did/physdesc/child::node()[last()]"/>
							</xforms:trigger>
						</xforms:group>
						<xforms:trigger appearance="minimal">
							<xforms:label>
								<img src="/apps/numishare/images/add.gif"/>Dimension</xforms:label>
							<xforms:insert ev:event="DOMActivate" context="."
								origin="instance('dimensions-template')"
								nodeset="did/physdesc/child::node()[last()]"/>
						</xforms:trigger>
						<xforms:group ref=".[count(//physfacet[@type='edge']) &lt; 1]">
							<xforms:trigger appearance="minimal">
								<xforms:label>
									<img src="/apps/numishare/images/add.gif"/>Edge</xforms:label>
								<xforms:insert ev:event="DOMActivate" context="."
									origin="instance('edge-template')"
									nodeset="did/physdesc/child::node()[last()]"/>
							</xforms:trigger>
						</xforms:group>
						<xforms:group ref=".[count(//physfacet[@type='manufacture']) &lt; 1]">
							<xforms:trigger appearance="minimal">
								<xforms:label>
									<img src="/apps/numishare/images/add.gif"/>Manufacture</xforms:label>
								<xforms:insert ev:event="DOMActivate" context="."
									origin="instance('manufacture-template')"
									nodeset="did/physdesc/child::node()[last()]"/>
							</xforms:trigger>
						</xforms:group>
						<xforms:trigger appearance="minimal">
							<xforms:label>
								<img src="/apps/numishare/images/add.gif"/>Material</xforms:label>
							<xforms:insert ev:event="DOMActivate" context="."
								origin="instance('material-template')"
								nodeset="did/physdesc/child::node()[last()]"/>
						</xforms:trigger>
						<xforms:group ref=".[count(//physfacet[@type='netGrade']) &lt; 1]">
							<xforms:trigger appearance="minimal">
								<xforms:label>
									<img src="/apps/numishare/images/add.gif"/>Net
									Grade</xforms:label>
								<xforms:insert ev:event="DOMActivate" context="."
									origin="instance('netGrade-template')"
									nodeset="did/physdesc/child::node()[last()]"/>
							</xforms:trigger>
						</xforms:group>
						<xforms:group ref=".[count(//physfacet[@type='obverseGrade']) &lt; 1]">
							<xforms:trigger appearance="minimal">
								<xforms:label>
									<img src="/apps/numishare/images/add.gif"/>Obverse
									Grade</xforms:label>
								<xforms:insert ev:event="DOMActivate" context="."
									origin="instance('obverseGrade-template')"
									nodeset="did/physdesc/child::node()[last()]"/>
							</xforms:trigger>
						</xforms:group>
						<xforms:group ref=".[count(//physfacet[@type='obverseLegend']) &lt; 1]">
							<xforms:trigger appearance="minimal">
								<xforms:label>
									<img src="/apps/numishare/images/add.gif"/>Obverse
									Legend</xforms:label>
								<xforms:insert ev:event="DOMActivate" context="."
									origin="instance('obverseLegend-template')"
									nodeset="did/physdesc/child::node()[last()]"/>
							</xforms:trigger>
						</xforms:group>
						<xforms:group
							ref=".[count(//physfacet[@type='obverseType']) &lt; 1]">
							<xforms:trigger appearance="minimal">
								<xforms:label>
									<img src="/apps/numishare/images/add.gif"/>Obverse
									Iconography</xforms:label>
								<xforms:insert ev:event="DOMActivate" context="."
									origin="instance('obverseType-template')"
									nodeset="did/physdesc/child::node()[last()]"/>
							</xforms:trigger>
						</xforms:group>
						<xforms:group ref=".[count(//physfacet[@type='obverseSymbol']) &lt; 1]">
							<xforms:trigger appearance="minimal">
								<xforms:label>
									<img src="/apps/numishare/images/add.gif"/>Obverse
									Symbol</xforms:label>
								<xforms:insert ev:event="DOMActivate" context="."
									origin="instance('obverseSymbol-template')"
									nodeset="did/physdesc/child::node()[last()]"/>
							</xforms:trigger>
						</xforms:group>
						<xforms:group ref=".[count(//physfacet[@type='reverseGrade']) &lt; 1]">
							<xforms:trigger appearance="minimal">
								<xforms:label>
									<img src="/apps/numishare/images/add.gif"/>Reverse
									Grade</xforms:label>
								<xforms:insert ev:event="DOMActivate" context="."
									origin="instance('reverseGrade-template')"
									nodeset="did/physdesc/child::node()[last()]"/>
							</xforms:trigger>
						</xforms:group>
						<xforms:group ref=".[count(//physfacet[@type='reverseLegend']) &lt; 1]">
							<xforms:trigger appearance="minimal">
								<xforms:label>
									<img src="/apps/numishare/images/add.gif"/>Reverse
									Legend</xforms:label>
								<xforms:insert ev:event="DOMActivate" context="."
									origin="instance('reverseLegend-template')"
									nodeset="did/physdesc/child::node()[last()]"/>
							</xforms:trigger>
						</xforms:group>
						<xforms:group
							ref=".[count(//physfacet[@type='reverseType']) &lt; 1]">
							<xforms:trigger appearance="minimal">
								<xforms:label>
									<img src="/apps/numishare/images/add.gif"/>Reverse
									Iconography</xforms:label>
								<xforms:insert ev:event="DOMActivate" context="."
									origin="instance('reverseType-template')"
									nodeset="did/physdesc/child::node()[last()]"/>
							</xforms:trigger>
						</xforms:group>
						<xforms:group ref=".[count(//physfacet[@type='reverseSymbol']) &lt; 1]">
							<xforms:trigger appearance="minimal">
								<xforms:label>
									<img src="/apps/numishare/images/add.gif"/>Reverse
									Symbol</xforms:label>
								<xforms:insert ev:event="DOMActivate" context="."
									origin="instance('reverseSymbol-template')"
									nodeset="did/physdesc/child::node()[last()]"/>
							</xforms:trigger>
						</xforms:group>						
						<xforms:group ref=".[count(//physfacet[@type='sernum']) &lt; 1]">
							<xforms:trigger appearance="minimal">
								<xforms:label>
									<img src="/apps/numishare/images/add.gif"/>Serial Number</xforms:label>
								<xforms:insert ev:event="DOMActivate" context="."
									origin="instance('sernum-template')"
									nodeset="did/physdesc/child::node()[last()]"/>
							</xforms:trigger>
						</xforms:group>
						<xforms:group ref=".[count(//physfacet[@type='shape']) &lt; 1]">
							<xforms:trigger appearance="minimal">
								<xforms:label>
									<img src="/apps/numishare/images/add.gif"/>Shape</xforms:label>
								<xforms:insert ev:event="DOMActivate" context="."
									origin="instance('shape-template')"
									nodeset="did/physdesc/child::node()[last()]"/>
							</xforms:trigger>
						</xforms:group>
						<xforms:group ref=".[count(//physfacet[@type='signature']) &lt; 1]">
							<xforms:trigger appearance="minimal">
								<xforms:label>
									<img src="/apps/numishare/images/add.gif"/>Signature</xforms:label>
								<xforms:insert ev:event="DOMActivate" context="."
									origin="instance('signature-template')"
									nodeset="did/physdesc/child::node()[last()]"/>
							</xforms:trigger>
						</xforms:group>
						<xforms:group ref=".[count(//physfacet[@type='symbol']) &lt; 1]">
							<xforms:trigger appearance="minimal">
								<xforms:label>
									<img src="/apps/numishare/images/add.gif"/>Symbol</xforms:label>
								<xforms:insert ev:event="DOMActivate" context="."
									origin="instance('symbol-template')"
									nodeset="did/physdesc/child::node()[last()]"/>
							</xforms:trigger>
						</xforms:group>
						<xforms:group ref=".[count(//physfacet[@type='undertype']) &lt; 1]">
							<xforms:trigger appearance="minimal">
								<xforms:label>
									<img src="/apps/numishare/images/add.gif"/>Undertype</xforms:label>
								<xforms:insert ev:event="DOMActivate" context="."
									origin="instance('undertype-template')"
									nodeset="did/physdesc/child::node()[last()]"/>
							</xforms:trigger>
						</xforms:group>
						<xforms:group ref=".[count(//physfacet[@type='watermark']) &lt; 1]">
							<xforms:trigger appearance="minimal">
								<xforms:label>
									<img src="/apps/numishare/images/add.gif"/>Watermark</xforms:label>
								<xforms:insert ev:event="DOMActivate" context="."
									origin="instance('watermark-template')"
									nodeset="did/physdesc/child::node()[last()]"/>
							</xforms:trigger>
						</xforms:group>
						<xforms:group ref=".[count(//physfacet[@type='weight']) &lt; 1]">
							<xforms:trigger appearance="minimal">
								<xforms:label>
									<img src="/apps/numishare/images/add.gif"/>Weight</xforms:label>
								<xforms:insert ev:event="DOMActivate" context="."
									origin="instance('weight-template')"
									nodeset="did/physdesc/child::node()[last()]"/>
							</xforms:trigger>
						</xforms:group>
					</xxforms:dialog>
					<!-- format, required -->
					<xforms:group ref="did/physdesc">
						<!-- format --> <div>
							<xforms:select1 ref="genreform[@type='format']">
								<xforms:label>Format</xforms:label>
								<xforms:alert>Required</xforms:alert>
								<xforms:item>
									<xforms:label>Select...</xforms:label>
									<xforms:value/>
								</xforms:item>
								<xforms:itemset nodeset="instance('formats')/format">
									<xforms:label ref="@label"/>
									<xforms:value ref="@value"/>
								</xforms:itemset>
							</xforms:select1>
						</div>
						<!-- denomination -->
						
						<!-- color -->
						<xi:include href="inputs/color.xml"/>
						
						<xi:include href="inputs/denomination.xml"/>
						<xforms:group
							ref="physfacet[@type='axis']">
							<div>
								<xforms:input ref=".">
									<xforms:label>Axis</xforms:label>
								</xforms:input>
								<xforms:trigger appearance="minimal">
									<xforms:delete ev:event="DOMActivate" nodeset="."/>
									<xforms:label>
										<img src="/apps/numishare/images/remove.gif"/>
									</xforms:label>
								</xforms:trigger>
							</div>
						</xforms:group>
						<xforms:group
							ref="physfacet[@type='counterstamp']">
							<div>
								<xforms:input ref=".">
									<xforms:label>Counterstamp</xforms:label>
								</xforms:input>
								<xforms:trigger appearance="minimal">
									<xforms:delete ev:event="DOMActivate" nodeset="."/>
									<xforms:label>
										<img src="/apps/numishare/images/remove.gif"/>
									</xforms:label>
								</xforms:trigger>
							</div>
						</xforms:group>
						<xforms:group
							ref="physfacet[@type='dob']">
							<div>
								<xforms:input ref=".">
									<xforms:label>Date on Object</xforms:label>
								</xforms:input>
								<xforms:trigger appearance="minimal">
									<xforms:delete ev:event="DOMActivate" nodeset="."/>
									<xforms:label>
										<img src="/apps/numishare/images/remove.gif"/>
									</xforms:label>
								</xforms:trigger>
							</div>
						</xforms:group>
						<!-- dimensions -->
						<xforms:repeat nodeset="dimensions">
							<div>
								<xforms:input ref=".">
									<xforms:label>Dimension (mm)</xforms:label>
									<xforms:alert>Dimension must be a number</xforms:alert>
									<xforms:hint>e.g., diameter. If other than diameter, multiple
										dimensions may be used.</xforms:hint>
								</xforms:input>
								<xforms:trigger appearance="minimal">
									<xforms:delete ev:event="DOMActivate" nodeset="."/>
									<xforms:label>
										<img src="/apps/numishare/images/remove.gif"/>
									</xforms:label>
								</xforms:trigger>
							</div>
						</xforms:repeat>
						<xforms:group ref="physfacet[@type='edge']">
							<div>
								<xforms:input ref=".">
									<xforms:label>Edge</xforms:label>
								</xforms:input>
								<xforms:trigger appearance="minimal">
									<xforms:delete ev:event="DOMActivate" nodeset="."/>
									<xforms:label>
										<img src="/apps/numishare/images/remove.gif"/>
									</xforms:label>
								</xforms:trigger>
							</div>
						</xforms:group>
						<xforms:group
							ref="physfacet[@type='manufacture']">
							<div>
								<xforms:input ref=".">
									<xforms:label>Manufacture</xforms:label>
								</xforms:input>
								<xforms:trigger appearance="minimal">
									<xforms:delete ev:event="DOMActivate" nodeset="."/>
									<xforms:label>
										<img src="/apps/numishare/images/remove.gif"/>
									</xforms:label>
								</xforms:trigger>
							</div>
						</xforms:group>
						<!-- material -->
						<xi:include href="inputs/material.xml"/>
						<xforms:group ref="physfacet[@type='netGrade']">
							<div>
								<xforms:select1 ref=".">
									<xforms:label>Net Grade</xforms:label>
									<xforms:alert>Required</xforms:alert>
									<xforms:item>
										<xforms:label>Select...</xforms:label>
										<xforms:value/>
									</xforms:item>
									<xforms:itemset nodeset="instance('grades')/grade">
										<xforms:label ref="@label"/>
										<xforms:value ref="@value"/>
									</xforms:itemset>
								</xforms:select1>
								<xforms:trigger appearance="minimal">
									<xforms:delete ev:event="DOMActivate" nodeset="."/>
									<xforms:label>
										<img src="/apps/numishare/images/remove.gif"/>
									</xforms:label>
								</xforms:trigger>
							</div>
						</xforms:group>
						<xforms:group ref="physfacet[@type='obverseGrade']">
							<div>
								<xforms:select1 ref=".">
									<xforms:label>Obverse Grade</xforms:label>
									<xforms:alert>Required</xforms:alert>
									<xforms:item>
										<xforms:label>Select...</xforms:label>
										<xforms:value/>
									</xforms:item>
									<xforms:itemset nodeset="instance('grades')/grade">
										<xforms:label ref="@label"/>
										<xforms:value ref="@value"/>
									</xforms:itemset>
								</xforms:select1>
								<xforms:trigger appearance="minimal">
									<xforms:delete ev:event="DOMActivate" nodeset="."/>
									<xforms:label>
										<img src="/apps/numishare/images/remove.gif"/>
									</xforms:label>
								</xforms:trigger>
							</div>
						</xforms:group>
						<xforms:group ref="physfacet[@type='obverseLegend']">
							<div>
								<xforms:input ref=".">
									<xforms:label>Obverse Legend</xforms:label>
								</xforms:input>
								<xforms:trigger appearance="minimal">
									<xforms:delete ev:event="DOMActivate" nodeset="."/>
									<xforms:label>
										<img src="/apps/numishare/images/remove.gif"/>
									</xforms:label>
								</xforms:trigger>
							</div>
						</xforms:group>
						<xforms:group ref="physfacet[@type='obverseType']">
							<div>
								<xforms:input ref=".">
									<xforms:label>Obverse Iconography</xforms:label>
								</xforms:input>
								<xforms:trigger appearance="minimal">
									<xforms:delete ev:event="DOMActivate" nodeset="."/>
									<xforms:label>
										<img src="/apps/numishare/images/remove.gif"/>
									</xforms:label>
								</xforms:trigger>
							</div>
						</xforms:group>
						<xforms:group ref="physfacet[@type='obverseSymbol']">
							<div>
								<xforms:input ref=".">
									<xforms:label>Obverse Symbol</xforms:label>
								</xforms:input>
								<xforms:trigger appearance="minimal">
									<xforms:delete ev:event="DOMActivate" nodeset="."/>
									<xforms:label>
										<img src="/apps/numishare/images/remove.gif"/>
									</xforms:label>
								</xforms:trigger>
							</div>
						</xforms:group>
						<xforms:group ref="physfacet[@type='reverseGrade']">
							<div>
								<xforms:select1 ref=".">
									<xforms:label>Reverse Grade</xforms:label>
									<xforms:alert>Required</xforms:alert>
									<xforms:item>
										<xforms:label>Select...</xforms:label>
										<xforms:value/>
									</xforms:item>
									<xforms:itemset nodeset="instance('grades')/grade">
										<xforms:label ref="@label"/>
										<xforms:value ref="@value"/>
									</xforms:itemset>
								</xforms:select1>
								<xforms:trigger appearance="minimal">
									<xforms:delete ev:event="DOMActivate" nodeset="."/>
									<xforms:label>
										<img src="/apps/numishare/images/remove.gif"/>
									</xforms:label>
								</xforms:trigger>
							</div>
						</xforms:group>
						<xforms:group ref="physfacet[@type='reverseLegend']">
							<div>
								<xforms:input ref=".">
									<xforms:label>Reverse Legend</xforms:label>
								</xforms:input>
								<xforms:trigger appearance="minimal">
									<xforms:delete ev:event="DOMActivate" nodeset="."/>
									<xforms:label>
										<img src="/apps/numishare/images/remove.gif"/>
									</xforms:label>
								</xforms:trigger>
							</div>
						</xforms:group>
						<xforms:group ref="physfacet[@type='reverseType']">
							<div>
								<xforms:input ref=".">
									<xforms:label>Reverse Iconography</xforms:label>
								</xforms:input>
								<xforms:trigger appearance="minimal">
									<xforms:delete ev:event="DOMActivate" nodeset="."/>
									<xforms:label>
										<img src="/apps/numishare/images/remove.gif"/>
									</xforms:label>
								</xforms:trigger>
							</div>
						</xforms:group>
						<xforms:group ref="physfacet[@type='reverseSymbol']">
							<div>
								<xforms:input ref=".">
									<xforms:label>Reverse Symbol</xforms:label>
								</xforms:input>
								<xforms:trigger appearance="minimal">
									<xforms:delete ev:event="DOMActivate" nodeset="."/>
									<xforms:label>
										<img src="/apps/numishare/images/remove.gif"/>
									</xforms:label>
								</xforms:trigger>
							</div>
						</xforms:group>
						<xforms:group ref="physfacet[@type='sernum']">
							<div>
								<xforms:input ref=".">
									<xforms:label>Serial Number</xforms:label>
								</xforms:input>
								<xforms:trigger appearance="minimal">
									<xforms:delete ev:event="DOMActivate" nodeset="."/>
									<xforms:label>
										<img src="/apps/numishare/images/remove.gif"/>
									</xforms:label>
								</xforms:trigger>
							</div>
						</xforms:group>
						<xforms:group ref="physfacet[@type='shape']">
							<div>
								<xforms:input ref=".">
									<xforms:label>Shape</xforms:label>
								</xforms:input>
								<xforms:trigger appearance="minimal">
									<xforms:delete ev:event="DOMActivate" nodeset="."/>
									<xforms:label>
										<img src="/apps/numishare/images/remove.gif"/>
									</xforms:label>
								</xforms:trigger>
							</div>
						</xforms:group>
						<xforms:group ref="physfacet[@type='signature']">
							<div>
								<xforms:input ref=".">
									<xforms:label>Signature</xforms:label>
								</xforms:input>
								<xforms:trigger appearance="minimal">
									<xforms:delete ev:event="DOMActivate" nodeset="."/>
									<xforms:label>
										<img src="/apps/numishare/images/remove.gif"/>
									</xforms:label>
								</xforms:trigger>
							</div>
						</xforms:group>
						<xforms:group ref="physfacet[@type='symbol']">
							<div>
								<xforms:input ref=".">
									<xforms:label>Symbol</xforms:label>
								</xforms:input>
								<xforms:trigger appearance="minimal">
									<xforms:delete ev:event="DOMActivate" nodeset="."/>
									<xforms:label>
										<img src="/apps/numishare/images/remove.gif"/>
									</xforms:label>
								</xforms:trigger>
							</div>
						</xforms:group>
						<xforms:group ref="physfacet[@type='undertype']">
							<div>
								<xforms:input ref=".">
									<xforms:label>Undertype</xforms:label>
								</xforms:input>
								<xforms:trigger appearance="minimal">
									<xforms:delete ev:event="DOMActivate" nodeset="."/>
									<xforms:label>
										<img src="/apps/numishare/images/remove.gif"/>
									</xforms:label>
								</xforms:trigger>
							</div>
						</xforms:group>
						<xforms:group ref="physfacet[@type='watermark']">
							<div>
								<xforms:input ref=".">
									<xforms:label>Watermark</xforms:label>
								</xforms:input>
								<xforms:trigger appearance="minimal">
									<xforms:delete ev:event="DOMActivate" nodeset="."/>
									<xforms:label>
										<img src="/apps/numishare/images/remove.gif"/>
									</xforms:label>
								</xforms:trigger>
							</div>
						</xforms:group>
						<xforms:group ref="physfacet[@type='weight']">
							<div>
								<xforms:input ref=".">
									<xforms:label>Weight</xforms:label>
								</xforms:input>
								<xforms:trigger appearance="minimal">
									<xforms:delete ev:event="DOMActivate" nodeset="."/>
									<xforms:label>
										<img src="/apps/numishare/images/remove.gif"/>
									</xforms:label>
								</xforms:trigger>
							</div>
						</xforms:group>
					</xforms:group>
					<!-- phystech for mintmarks and countermarks and other physical attributes like wear -->
					<!--<xforms:repeat id="phystech" nodeset="phystech">
						<div>
							<xforms:input ref="p">
								<xforms:label>Mintmark/<br/>Counterstamp</xforms:label>
							</xforms:input>
							<xforms:trigger appearance="minimal">
								<xforms:delete ev:event="DOMActivate" nodeset="."
									at="index('phystech')"/>
								<xforms:label>
									<img src="/apps/numishare/images/remove.gif"/>
								</xforms:label>
							</xforms:trigger>
						</div>
					</xforms:repeat>-->
				</div>
				<!-- Mint/origination -->
				<xforms:group ref="did/origination">
					<div class="section">
						<h2>Mint/Origination</h2>
						<xforms:trigger appearance="minimal">
							<xforms:delete ev:event="DOMActivate" nodeset="."/>
							<xforms:label>
								<img src="/apps/numishare/images/remove.gif"/>
							</xforms:label>
						</xforms:trigger>
						<div class="trigger_container">
							<xforms:trigger appearance="minimal">
								<xforms:label>
									<img src="/apps/numishare/images/add.gif"/>City</xforms:label>
								<xforms:insert ev:event="DOMActivate" context="."
									origin="instance('city-template')"/>
							</xforms:trigger>
							<xforms:trigger appearance="minimal">
								<xforms:label>
									<img src="/apps/numishare/images/add.gif"/>Other
									Place</xforms:label>
								<xforms:insert ev:event="DOMActivate" context="."
									origin="instance('geogname-template')"/>
							</xforms:trigger>
							<xforms:trigger appearance="minimal">
								<xforms:label>
									<img src="/apps/numishare/images/add.gif"/>Region</xforms:label>
								<xforms:insert ev:event="DOMActivate" context="."
									origin="instance('region-template')"/>
							</xforms:trigger>
							<xforms:trigger appearance="minimal">
								<xforms:label>
									<img src="/apps/numishare/images/add.gif"/>State</xforms:label>
								<xforms:insert ev:event="DOMActivate" context="."
									origin="instance('state-template')"/>
							</xforms:trigger>
						</div>
						<!-- city, origination -->
						<xi:include href="inputs/origination-city.xml"/>
						<!-- city, origination -->
						<xi:include href="inputs/origination-region.xml"/>
						<!-- city, origination -->
						<xi:include href="inputs/origination-state.xml"/>
						<xforms:repeat
							nodeset="geogname[not(@role='city') and not(@role='region') and not(@role='state')]">
							<div class="pair_div">
								<div>
									<xforms:input ref=".">
										<xforms:label>Place</xforms:label>
									</xforms:input>
								</div>
								<div>
									<xforms:input ref="@role">
										<xforms:label>Role</xforms:label>
									</xforms:input>
								</div>
								<div style="float:right;">
									<xforms:trigger appearance="minimal">
										<xforms:delete ev:event="DOMActivate" nodeset="."/>
										<xforms:label>
											<img src="/apps/numishare/images/remove.gif"/>
										</xforms:label>
									</xforms:trigger>
								</div>
							</div>
						</xforms:repeat>
					</div>
				</xforms:group>
				<!-- images -->
				<xforms:group id="daogrp" ref="did/daogrp">
					<div class="section">
						<h2>Images</h2>
						<xforms:trigger appearance="minimal">
							<xforms:delete ev:event="DOMActivate" nodeset="."/>
							<xforms:label>
								<img src="/apps/numishare/images/remove.gif"/>
							</xforms:label>
						</xforms:trigger>
						<div class="trigger_container">
							<xforms:group ref=".[count(daoloc[@label='thumb_obv']) &lt; 1]">
								<xforms:trigger appearance="minimal">
									<xforms:label>
										<img src="/apps/numishare/images/add.gif"/>Obverse
										Image</xforms:label>
									<xforms:action ev:event="DOMActivate">
										<xforms:setvalue ref="instance('image-side')"
											value="'obverse'"/>
									</xforms:action>
								</xforms:trigger>
							</xforms:group>
							<xforms:group ref=".[count(daoloc[@label='thumb_rev']) &lt; 1]">
								<xforms:trigger appearance="minimal">
									<xforms:label>
										<img src="/apps/numishare/images/add.gif"/>Reverse
										Image</xforms:label>
									<xforms:action ev:event="DOMActivate">
										<xforms:setvalue ref="instance('image-side')"
											value="'reverse'"/>
									</xforms:action>
								</xforms:trigger>
							</xforms:group>
						</div>
						<xforms:group ref=".[string-length(instance('image-side')) &gt; 0]">
							<div class="subsection">
								<h3>
									<xforms:output
										ref="concat('Upload ', upper-case(substring(instance('image-side'), 1, 1)), substring(instance('image-side'), 2), ' Image')"
									/>
								</h3>
								<fr:upload ref="instance('files-instance')/file" xxforms:size="60">
									<xforms:filename ref="@filename"/>
									<xforms:mediatype ref="@mediatype"/>
									<xxforms:size ref="@size"/>
								</fr:upload>
								<p>
									<xforms:trigger>
										<xforms:label>Upload</xforms:label>
										<xforms:action ev:event="DOMActivate"
											if="instance('image-side') = 'obverse'">
											<xforms:insert context="."
												origin="instance('thumb_obv-template')"/>
											<xforms:insert context="."
												origin="instance('screen_obv-template')"/>
											<xforms:insert context="."
												origin="instance('master_obv-template')"/>
											<xxforms:hide dialog="image-upload"/>
											<xforms:send submission="upload-obverse-resize"/>
										</xforms:action>
										<xforms:action ev:event="DOMActivate"
											if="instance('image-side') = 'reverse'">
											<xforms:insert context="."
												origin="instance('thumb_rev-template')"/>
											<xforms:insert context="."
												origin="instance('screen_rev-template')"/>
											<xforms:insert context="."
												origin="instance('master_rev-template')"/>
											<xxforms:hide dialog="image-upload"/>
											<xforms:send submission="upload-reverse-resize"/>
										</xforms:action>
									</xforms:trigger>
								</p>
							</div>
						</xforms:group>
						<!-- obverse image -->
						<xforms:group
							ref=".[string-length(daoloc[@label='thumb_obv']/@href) &gt; 0]">
							<!-- concatonate thumbnail path -->
							<xxforms:variable name="thumbnail-path"
								select="concat('file:', instance('site-info')/images/absolute_path, 'thumb/', substring-after(daoloc[@label='thumb_obv']/@href, 'images/artifacts/thumb/'))"
							/> <div class="subsection">
								<h3>Obverse Image</h3>
								<xforms:trigger appearance="minimal">
									<xforms:dispatch target="delete-obverse-dialog" name="fr-show"
										ev:event="DOMActivate"/>
									<xforms:label>
										<img src="/apps/numishare/images/remove.gif"/>
									</xforms:label>
								</xforms:trigger>
								<div>
									<xforms:output mediatype="image/*" value="$thumbnail-path"/>
								</div>
								<fr:alert-dialog id="delete-obverse-dialog">
									<fr:label>Delete Obverse Image</fr:label>
									<fr:message> Are you certain you wish to remove this image? Its
										reference will be removed from the document and files from
										the server. </fr:message>
									<fr:negative-choice/>
									<fr:positive-choice>
										<xforms:action ev:event="DOMActivate">
											<!-- get filename -->
											<xforms:setvalue
												ref="instance('delete-config')/delete/file"
												value="substring-after(instance('coin')/did/daogrp/daoloc[@label='thumb_obv']/@href, 'images/artifacts/thumb/')"
											/>
											<!-- THUMBNAIL -->
											<xforms:setvalue
												ref="instance('delete-config')/delete/directory"
												value="concat(instance('site-info')/images/absolute_path, 'thumb')"/>
											<xforms:insert context="instance('dump')"
												origin="xxforms:call-xpl('oxf:/apps/numishare/xpl/remove-image.xpl', ('delete-config', 'dump'), (instance('delete-config'), instance('dump')), 'data')"
											/>
											<!-- SCREEN -->
											<xforms:setvalue
												ref="instance('delete-config')/delete/directory"
												value="concat(instance('site-info')/images/absolute_path, 'screen')"/>
											<xforms:insert context="instance('dump')"
												origin="xxforms:call-xpl('oxf:/apps/numishare/xpl/remove-image.xpl', ('delete-config', 'dump'), (instance('delete-config'), instance('dump')), 'data')"
											/>
											<!-- ARCHIVE -->
											<xforms:setvalue
												ref="instance('delete-config')/delete/directory"
												value="concat(instance('site-info')/images/absolute_path, 'archive')"/>
											<xforms:insert context="instance('dump')"
												origin="xxforms:call-xpl('oxf:/apps/numishare/xpl/remove-image.xpl', ('delete-config', 'dump'), (instance('delete-config'), instance('dump')), 'data')"
											/> <xforms:delete
												nodeset="instance('coin')/did/daogrp/daoloc[@label='thumb_obv']"/>
											<xforms:delete
												nodeset="instance('coin')/did/daogrp/daoloc[@label='screen_obv']"/>
											<xforms:delete
												nodeset="instance('coin')/did/daogrp/daoloc[@label='master_obv']"
											/>
										</xforms:action> <xforms:setvalue
											ref="instance('image-side')" value="''"/>
									</fr:positive-choice>
								</fr:alert-dialog>
							</div>
						</xforms:group>
						<!-- reverse image -->
						<xforms:group
							ref=".[string-length(daoloc[@label='thumb_rev']/@href) &gt; 0]">
							<!-- concatonate thumbnail path -->
							<xxforms:variable name="thumbnail-path"
								select="concat('file:', instance('site-info')/images/absolute_path, 'thumb/', substring-after(daoloc[@label='thumb_rev']/@href, 'images/artifacts/thumb/'))"
							/> <div class="subsection">
								<h3>Reverse Image</h3>
								<xforms:trigger appearance="minimal">
									<xforms:dispatch target="delete-reverse-dialog" name="fr-show"
										ev:event="DOMActivate"/>
									<xforms:label>
										<img src="/apps/numishare/images/remove.gif"/>
									</xforms:label>
								</xforms:trigger>
								<div>
									<xforms:output mediatype="image/*" value="$thumbnail-path"/>
								</div>
								<fr:alert-dialog id="delete-reverse-dialog">
									<fr:label>Delete Reverse Image</fr:label>
									<fr:message> Are you certain you wish to remove this image? Its
										reference will be removed from the document and files from
										the server. </fr:message>
									<fr:negative-choice/>
									<fr:positive-choice>
										<xforms:action ev:event="DOMActivate">
											<!-- get filename -->
											<xforms:setvalue
												ref="instance('delete-config')/delete/file"
												value="substring-after(instance('coin')/did/daogrp/daoloc[@label='thumb_rev']/@href, 'images/artifacts/thumb/')"
											/>
											<!-- THUMBNAIL -->
											<xforms:setvalue
												ref="instance('delete-config')/delete/directory"
												value="concat(instance('site-info')/images/absolute_path, 'thumb')"/>
											<xforms:insert context="instance('dump')"
												origin="xxforms:call-xpl('oxf:/apps/numishare/xpl/remove-image.xpl', ('delete-config', 'dump'), (instance('delete-config'), instance('dump')), 'data')"
											/>
											<!-- SCREEN -->
											<xforms:setvalue
												ref="instance('delete-config')/delete/directory"
												value="concat(instance('site-info')/images/absolute_path, 'screen')"/>
											<xforms:insert context="instance('dump')"
												origin="xxforms:call-xpl('oxf:/apps/numishare/xpl/remove-image.xpl', ('delete-config', 'dump'), (instance('delete-config'), instance('dump')), 'data')"
											/>
											<!-- ARCHIVE -->
											<xforms:setvalue
												ref="instance('delete-config')/delete/directory"
												value="concat(instance('site-info')/images/absolute_path, 'archive')"/>
											<xforms:insert context="instance('dump')"
												origin="xxforms:call-xpl('oxf:/apps/numishare/xpl/remove-image.xpl', ('delete-config', 'dump'), (instance('delete-config'), instance('dump')), 'data')"
											/> <xforms:delete
												nodeset="instance('coin')/did/daogrp/daoloc[@label='thumb_rev']"/>
											<xforms:delete
												nodeset="instance('coin')/did/daogrp/daoloc[@label='screen_rev']"/>
											<xforms:delete
												nodeset="instance('coin')/did/daogrp/daoloc[@label='master_rev']"
											/> <xforms:setvalue ref="instance('image-side')"
												value="''"/>
										</xforms:action>
									</fr:positive-choice>
								</fr:alert-dialog>
							</div>
						</xforms:group>
					</div>
				</xforms:group>
				<!-- bibliography -->
				<xforms:group id="bibliography" ref="bibliography">
					<div class="section">
						<h2>References</h2>
						<xforms:trigger appearance="minimal">
							<xforms:delete ev:event="DOMActivate" nodeset="."/>
							<xforms:label>
								<img src="/apps/numishare/images/remove.gif"/>
							</xforms:label>
						</xforms:trigger>
						<div class="trigger_container">
							<xforms:trigger appearance="minimal">
								<xforms:label>
									<img src="/apps/numishare/images/add.gif"/>Bibliographic
									Reference</xforms:label>
								<xforms:insert ev:event="DOMActivate" context="."
									origin="instance('bibref-template')"/>
							</xforms:trigger>
							<xforms:trigger appearance="minimal">
								<xforms:label>
									<img src="/apps/numishare/images/add.gif"/>Digital
									Resource</xforms:label>
								<xforms:insert ev:event="DOMActivate" context="."
									origin="instance('ref-template')"/>
							</xforms:trigger>
						</div>
						<xforms:repeat nodeset="bibref">
							<div class="pair_div">
								<div>
									<xforms:input ref="title">
										<xforms:label>Reference Title</xforms:label>
									</xforms:input>
								</div>
								<div>
									<xforms:input ref="num">
										<xforms:label>Reference Number</xforms:label>
									</xforms:input>
								</div>
								<div style="float:right;">
									<xforms:trigger appearance="minimal">
										<xforms:delete ev:event="DOMActivate" nodeset="."/>
										<xforms:label>
											<img src="/apps/numishare/images/remove.gif"/>
										</xforms:label>
									</xforms:trigger>
								</div>
							</div>
						</xforms:repeat>
						<xforms:repeat nodeset="ref">
							<div class="pair_div">
								<div>
									<xforms:input ref=".">
										<xforms:label>Linked Text</xforms:label>
									</xforms:input>
								</div>
								<div>
									<xforms:input ref="@href">
										<xforms:label>URL</xforms:label>
									</xforms:input>
								</div>
								<div style="float:right;">
									<xforms:trigger appearance="minimal">
										<xforms:delete ev:event="DOMActivate" nodeset="."/>
										<xforms:label>
											<img src="/apps/numishare/images/remove.gif"/>
										</xforms:label>
									</xforms:trigger>
								</div>
							</div>
						</xforms:repeat>
					</div>
				</xforms:group>
				<!-- archival information -->
				<div class="section">
					<h2>Archival Information</h2>
					<div class="trigger_container">
						<xforms:group ref=".[count(//appraisal) &lt; 1]">
							<xforms:trigger appearance="minimal">
								<xforms:label>
									<img src="/apps/numishare/images/add.gif"
									/>Appraisal</xforms:label>
								<xforms:insert ev:event="DOMActivate" context="."
									origin="instance('appraisal-template')" nodeset="did"
									position="after"/>
							</xforms:trigger>
						</xforms:group>
						<xforms:group ref=".[count(//acqinfo) &lt; 1]">
							<xforms:trigger appearance="minimal">
								<xforms:label>
									<img src="/apps/numishare/images/add.gif"/>Acquisition
									Info</xforms:label>
								<xforms:insert ev:event="DOMActivate" context="."
									origin="instance('acqinfo-template')" nodeset="did"
									position="after"/>
							</xforms:trigger>
						</xforms:group>
						<xforms:group ref=".[count(//custodhist) &lt; 1]">
							<xforms:trigger appearance="minimal">
								<xforms:label>
									<img src="/apps/numishare/images/add.gif"/>Custodial
									History</xforms:label>
								<xforms:insert ev:event="DOMActivate" context="."
									origin="instance('custodhist-template')" nodeset="did"
									position="after"/>
							</xforms:trigger>
						</xforms:group>
					</div>
					<!-- appraisal -->
					<xforms:repeat id="appraisal" nodeset="appraisal">
						<div>
							<xforms:input ref="p">
								<xforms:label>Appraisal</xforms:label>
							</xforms:input>
							<xforms:trigger appearance="minimal">
								<xforms:delete ev:event="DOMActivate" nodeset="."
									at="index('appraisal')"/>
								<xforms:label>
									<img src="/apps/numishare/images/remove.gif"/>
								</xforms:label>
							</xforms:trigger>
						</div>
					</xforms:repeat>
					<!-- acquisition information -->
					<xforms:repeat id="acqinfo" nodeset="acqinfo">
						<div>
							<xforms:input ref="p">
								<xforms:label>Acquisition Info</xforms:label>
							</xforms:input>
							<xforms:trigger appearance="minimal">
								<xforms:delete ev:event="DOMActivate" nodeset="."
									at="index('acqinfo')"/>
								<xforms:label>
									<img src="/apps/numishare/images/remove.gif"/>
								</xforms:label>
							</xforms:trigger>
						</div>
					</xforms:repeat>
					<!-- custodial history -->
					<xforms:repeat id="custodhist" nodeset="custodhist">
						<div>
							<xforms:input ref="p">
								<xforms:label>Custodial History</xforms:label>
							</xforms:input>
							<xforms:trigger appearance="minimal">
								<xforms:delete ev:event="DOMActivate" nodeset="."
									at="index('custodhist')"/>
								<xforms:label>
									<img src="/apps/numishare/images/remove.gif"/>
								</xforms:label>
							</xforms:trigger>
						</div>
					</xforms:repeat>
				</div>
				<!-- Index Terms / <controlaccess> -->
				<xforms:group ref="controlaccess">
					<div class="section">
						<h2>Index Terms</h2>
						<xforms:trigger appearance="minimal">
							<xforms:delete ev:event="DOMActivate" nodeset="."/>
							<xforms:label>
								<img src="/apps/numishare/images/remove.gif"/>
							</xforms:label>
						</xforms:trigger>
						<div class="trigger_container">
							<xforms:trigger appearance="minimal">
								<xforms:label>
									<img src="/apps/numishare/images/add.gif"/>Artist</xforms:label>
								<xforms:insert ev:event="DOMActivate" context="."
									nodeset="./child::node()[last()]"
									origin="instance('artist-template')"/>
							</xforms:trigger>							
							<xforms:trigger appearance="minimal">
								<xforms:label>
									<img src="/apps/numishare/images/add.gif"/>City</xforms:label>
								<xforms:insert ev:event="DOMActivate" context="."
									nodeset="./child::node()[last()]"
									origin="instance('city-template')"/>
							</xforms:trigger>
							<xforms:trigger appearance="minimal">
								<xforms:label>
									<img src="/apps/numishare/images/add.gif"/>Deity</xforms:label>
								<xforms:insert ev:event="DOMActivate" context="."
									nodeset="./child::node()[last()]"
									origin="instance('deity-template')"/>
							</xforms:trigger>
							<xforms:trigger appearance="minimal">
								<xforms:label>
									<img src="/apps/numishare/images/add.gif"
									/>Dynasty</xforms:label>
								<xforms:insert ev:event="DOMActivate" context="."
									nodeset="./child::node()[last()]"
									origin="instance('famname-template')"/>
							</xforms:trigger>
							<xforms:trigger appearance="minimal">
								<xforms:label>
									<img src="/apps/numishare/images/add.gif"/>Engraver</xforms:label>
								<xforms:insert ev:event="DOMActivate" context="."
									nodeset="./child::node()[last()]"
									origin="instance('engraver-template')"/>
							</xforms:trigger>
							<xforms:trigger appearance="minimal">
								<xforms:label>
									<img src="/apps/numishare/images/add.gif"/>Issuer (medal)</xforms:label>
								<xforms:insert ev:event="DOMActivate" context="."
									nodeset="./child::node()[last()]"
									origin="instance('issuer-template')"/>
							</xforms:trigger>
							<xforms:trigger appearance="minimal">
								<xforms:label>
									<img src="/apps/numishare/images/add.gif"/>Maker</xforms:label>
								<xforms:insert ev:event="DOMActivate" context="."
									nodeset="./child::node()[last()]"
									origin="instance('maker-template')"/>
							</xforms:trigger>
							<xforms:trigger appearance="minimal">
								<xforms:label>
									<img src="/apps/numishare/images/add.gif"/>Name</xforms:label>
								<xforms:insert ev:event="DOMActivate" context="."
									nodeset="./child::node()[last()]"
									origin="instance('persname-template')"/>
							</xforms:trigger>
							<xforms:trigger appearance="minimal">
								<xforms:label>
									<img src="/apps/numishare/images/add.gif"/>Other
									Place</xforms:label>
								<xforms:insert ev:event="DOMActivate" context="."
									nodeset="./child::node()[last()]"
									origin="instance('geogname-template')"/>
							</xforms:trigger>
							<xforms:trigger appearance="minimal">
								<xforms:label>
									<img src="/apps/numishare/images/add.gif"/>Political
									Entity</xforms:label>
								<xforms:insert ev:event="DOMActivate" context="."
									nodeset="./child::node()[last()]"
									origin="instance('corpname-template')"/>
							</xforms:trigger>
							<xforms:trigger appearance="minimal">
								<xforms:label>
									<img src="/apps/numishare/images/add.gif"/>Region</xforms:label>
								<xforms:insert ev:event="DOMActivate" context="."
									nodeset="./child::node()[last()]"
									origin="instance('region-template')"/>
							</xforms:trigger>
							<xforms:trigger appearance="minimal">
								<xforms:label>
									<img src="/apps/numishare/images/add.gif"/>State</xforms:label>
								<xforms:insert ev:event="DOMActivate" context="."
									nodeset="./child::node()[last()]"
									origin="instance('state-template')"/>
							</xforms:trigger>
							<xforms:trigger appearance="minimal">
								<xforms:label>
									<img src="/apps/numishare/images/add.gif"
									/>Subject</xforms:label>
								<xforms:insert ev:event="DOMActivate" context="."
									nodeset="./child::node()[last()]"
									origin="instance('subject-template')"/>
							</xforms:trigger>
							<xforms:trigger appearance="minimal">
								<xforms:label>
									<img src="/apps/numishare/images/add.gif"
									/>Subject--Event</xforms:label>
								<xforms:insert ev:event="DOMActivate" context="."
									nodeset="./child::node()[last()]"
									origin="instance('subjectEvent-template')"/>
							</xforms:trigger>
							<xforms:trigger appearance="minimal">
								<xforms:label>
									<img src="/apps/numishare/images/add.gif"
									/>Subject--Issuer</xforms:label>
								<xforms:insert ev:event="DOMActivate" context="."
									nodeset="./child::node()[last()]"
									origin="instance('subjectIssuer-template')"/>
							</xforms:trigger>
							<xforms:trigger appearance="minimal">
								<xforms:label>
									<img src="/apps/numishare/images/add.gif"
									/>Subject--Person</xforms:label>
								<xforms:insert ev:event="DOMActivate" context="."
									nodeset="./child::node()[last()]"
									origin="instance('subjectPerson-template')"/>
							</xforms:trigger>
							<xforms:trigger appearance="minimal">
								<xforms:label>
									<img src="/apps/numishare/images/add.gif"
									/>Subject--Place</xforms:label>
								<xforms:insert ev:event="DOMActivate" context="."
									nodeset="./child::node()[last()]"
									origin="instance('subjectPlace-template')"/>
							</xforms:trigger>
						</div>
						<xi:include href="inputs/artist.xml"/>
						<!-- city -->
						<xi:include href="inputs/city.xml"/>
						<!-- deity -->
						<xi:include href="inputs/deity.xml"/>
						
						<xi:include href="inputs/engraver.xml"/>
						
						<!-- dynasty -->
						<xi:include href="inputs/famname.xml"/>
						
						<xi:include href="inputs/issuer.xml"/>
						
						<xi:include href="inputs/maker.xml"/>
						
						<!-- persname, excluding deities -->
						<xi:include href="inputs/persname.xml"/>
						<xforms:repeat
							nodeset="geogname[not(@role='city') and not(@role='region') and not(@role='state')]">
							<div class="pair_div">
								<div>
									<xforms:input ref=".">
										<xforms:label>Place</xforms:label>
									</xforms:input>
								</div>
								<div>
									<xforms:input ref="@role">
										<xforms:label>Role</xforms:label>
									</xforms:input>
								</div>
								<div style="float:right;">
									<xforms:trigger appearance="minimal">
										<xforms:delete ev:event="DOMActivate" nodeset="."/>
										<xforms:label>
											<img src="/apps/numishare/images/remove.gif"/>
										</xforms:label>
									</xforms:trigger>
								</div>
							</div>
						</xforms:repeat>
						<xi:include href="inputs/corpname.xml"/>
						<!-- region -->
						<xi:include href="inputs/region.xml"/>
						<!-- region -->
						<xi:include href="inputs/state.xml"/>
						<xi:include href="inputs/subject.xml"/>
						<xi:include href="inputs/subjectEvent.xml"/>
						<xi:include href="inputs/subjectIssuer.xml"/>
						<xi:include href="inputs/subjectPerson.xml"/>
						<xi:include href="inputs/subjectPlace.xml"/>
					</div>
				</xforms:group>
				<!-- abstract -->
				<div class="section">
					<h2>Commentary</h2>
					<div class="trigger_container">
						<xforms:trigger appearance="minimal">
							<xforms:label>
								<img src="/apps/numishare/images/add.gif"/>Abstract</xforms:label>
							<xforms:insert ev:event="DOMActivate" context="."
								origin="instance('abstract-template')" nodeset="did"
								position="after"/>
						</xforms:trigger>
					</div>
					<xforms:repeat id="abstract" nodeset="abstract">
						<div class="pair_div">
							<div>
								<xforms:input ref="@label">
									<xforms:label>Title</xforms:label>
								</xforms:input>
							</div>
							<div>
								<xforms:textarea ref="." style="height:20em;">
									<xforms:label>Abstract</xforms:label>
								</xforms:textarea>
							</div>
							<div style="float:right;">
								<xforms:trigger appearance="minimal">
									<xforms:delete ev:event="DOMActivate" nodeset="."
										at="index('abstract')"/>
									<xforms:label>
										<img src="/apps/numishare/images/remove.gif"/>
									</xforms:label>
								</xforms:trigger>
							</div>
						</div>
					</xforms:repeat>
				</div>
			</xforms:group>
		</div>
		<!--<widget:xforms-instance-inspector id="orbeon-xforms-inspector"
			xmlns:widget="http://orbeon.org/oxf/xml/widget"/>-->
	</body>
</html>
